first commit
This commit is contained in:
31
pkg/types/port.go
Normal file
31
pkg/types/port.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
// PortInfo 表示端口信息
|
||||
type PortInfo struct {
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"` // tcp, udp
|
||||
State string `json:"state"` // LISTEN, ESTABLISHED, etc.
|
||||
Process string `json:"process"` // 进程名称
|
||||
PID int `json:"pid"` // 进程ID
|
||||
ServiceName string `json:"serviceName"` // 识别出的服务名称
|
||||
ServiceURL string `json:"serviceURL"` // 服务访问URL(如果是HTTP服务)
|
||||
LastSeen time.Time `json:"lastSeen"` // 最后发现时间
|
||||
}
|
||||
|
||||
// ScanResult 表示扫描结果
|
||||
type ScanResult struct {
|
||||
Ports []PortInfo `json:"ports"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
TotalPorts int `json:"totalPorts"`
|
||||
}
|
||||
|
||||
// ServiceMapping 表示端口到服务的映射
|
||||
type ServiceMapping struct {
|
||||
Port int `json:"port"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
Description string `json:"description"`
|
||||
IsHTTP bool `json:"isHTTP"`
|
||||
IsHTTPS bool `json:"isHTTPS"`
|
||||
}
|
||||
Reference in New Issue
Block a user