Documentation
¶
Index ¶
- func CertInfoJSON(info *CertInfo) ([]byte, error)
- func DNSResultJSON(result *DNSResult) ([]byte, error)
- func NetSocketsJSON(entries []SocketEntry) ([]byte, error)
- func URLInfoJSON(info *URLInfo) ([]byte, error)
- func URLInfoTable(info *URLInfo) string
- type CertInfo
- type DNSRecord
- type DNSResult
- type NetFilterOptions
- type SocketEntry
- type URLInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertInfoJSON ¶
func DNSResultJSON ¶ added in v0.5.0
DNSResultJSON returns JSON-encoded output.
func NetSocketsJSON ¶ added in v0.5.0
func NetSocketsJSON(entries []SocketEntry) ([]byte, error)
NetSocketsJSON returns JSON-encoded output for the socket list.
func URLInfoJSON ¶
URLInfoJSON returns the URL info as formatted JSON.
func URLInfoTable ¶
URLInfoTable returns a formatted table-style string.
Types ¶
type CertInfo ¶
type CertInfo struct {
Subject string `json:"subject"`
Issuer string `json:"issuer"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
SerialNumber string `json:"serial_number"`
SignatureAlgorithm string `json:"signature_algorithm"`
DNSNames []string `json:"dns_names,omitempty"`
IsExpired bool `json:"is_expired"`
}
CertInfo holds decoded X.509 certificate information.
func CertDecode ¶
type NetFilterOptions ¶ added in v0.5.0
NetFilterOptions controls which sockets are returned.
type SocketEntry ¶ added in v0.5.0
type SocketEntry struct {
Proto string `json:"proto"`
LocalIP string `json:"local_ip"`
LocalPort uint16 `json:"local_port"`
RemoteIP string `json:"remote_ip"`
RemotePort uint16 `json:"remote_port"`
State string `json:"state"`
PID int `json:"pid"`
Process string `json:"process"`
User string `json:"user"`
Service string `json:"service,omitempty"`
Container string `json:"container,omitempty"`
}
SocketEntry represents a single network socket with process info.
func ListSockets ¶ added in v0.5.0
func ListSockets(procRoot string, opts NetFilterOptions) ([]SocketEntry, error)
ListSockets scans /proc for socket information and returns filtered entries. procRoot allows tests to supply a fake /proc tree (default: "/proc").
type URLInfo ¶
type URLInfo struct {
Scheme string `json:"scheme"`
Host string `json:"host"`
Port string `json:"port,omitempty"`
Path string `json:"path,omitempty"`
Query map[string][]string `json:"query,omitempty"`
Fragment string `json:"fragment,omitempty"`
User string `json:"user,omitempty"`
}
URLInfo holds parsed URL components.
Click to show internal directories.
Click to hide internal directories.