Documentation
¶
Index ¶
- func CertInfoJSON(info *CertInfo) ([]byte, error)
- func DNSResultJSON(result *DNSResult) ([]byte, error)
- func DomainInfoJSON(info *DomainInfo) ([]byte, error)
- func LookupPublicIP() (string, error)
- func NetSocketsJSON(entries []SocketEntry) ([]byte, error)
- func SortSocketEntries(entries []SocketEntry)
- func SubnetInfoJSON(info *SubnetInfo) ([]byte, error)
- func URLInfoJSON(info *URLInfo) ([]byte, error)
- func URLInfoTable(info *URLInfo) string
- type CertInfo
- type DNSRecord
- type DNSResult
- type DomainInfo
- type NetFilterOptions
- type SocketEntry
- type SubnetInfo
- 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 DomainInfoJSON ¶ added in v0.6.0
func DomainInfoJSON(info *DomainInfo) ([]byte, error)
DomainInfoJSON returns JSON-encoded output.
func LookupPublicIP ¶ added in v0.6.0
LookupPublicIP returns the public IP address.
func NetSocketsJSON ¶ added in v0.5.0
func NetSocketsJSON(entries []SocketEntry) ([]byte, error)
NetSocketsJSON returns JSON-encoded output for the socket list.
func SortSocketEntries ¶ added in v0.7.1
func SortSocketEntries(entries []SocketEntry)
SortSocketEntries sorts entries by protocol then local port.
func SubnetInfoJSON ¶ added in v0.6.0
func SubnetInfoJSON(info *SubnetInfo) ([]byte, error)
SubnetInfoJSON returns JSON-encoded output.
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 DomainInfo ¶ added in v0.6.0
type DomainInfo struct {
Domain string `json:"domain"`
Registrar string `json:"registrar,omitempty"`
Created string `json:"created,omitempty"`
Expires string `json:"expires,omitempty"`
Updated string `json:"updated,omitempty"`
Status []string `json:"status,omitempty"`
Nameservers []string `json:"nameservers,omitempty"`
A []string `json:"a,omitempty"`
AAAA []string `json:"aaaa,omitempty"`
CNAME string `json:"cname,omitempty"`
TXT []string `json:"txt,omitempty"`
}
DomainInfo holds parsed RDAP and DNS information for a domain.
func LookupDomain ¶ added in v0.6.0
func LookupDomain(name string) (*DomainInfo, error)
LookupDomain queries RDAP and DNS for domain information.
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(opts NetFilterOptions) ([]SocketEntry, error)
ListSockets scans /proc for socket information and returns filtered entries.
type SubnetInfo ¶ added in v0.6.0
type SubnetInfo struct {
Network string `json:"network"`
Netmask string `json:"netmask"`
Broadcast string `json:"broadcast"`
First string `json:"first"`
Last string `json:"last"`
Hosts uint32 `json:"hosts"`
}
SubnetInfo holds parsed CIDR subnet information.
func ParseSubnet ¶ added in v0.6.0
func ParseSubnet(cidr string) (*SubnetInfo, error)
ParseSubnet parses a CIDR string and returns subnet information.
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.