Documentation
¶
Overview ¶
Package network regroups collecting information about the network interfaces
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAddressNotFound = errors.New("address not found")
ErrAddressNotFound means no such address could be found
Functions ¶
Types ¶
type Info ¶ added in v0.48.0
type Info struct {
// Interfaces is the list of interfaces which are up
Interfaces []Interface `json:"interfaces"`
// MacAddress is a mac address of the host
MacAddress string `json:"macaddress"`
// IPAddress is an IPv4 address of the host
IPAddress string `json:"ipaddress"`
// IPAddressV6 is an IPv6 address of the host
IPAddressV6 utils.Value[string] `json:"ipaddressv6"`
}
Info holds network metadata about the host
func CollectInfo ¶ added in v0.48.0
CollectInfo collects the network information.
type Interface ¶ added in v0.48.0
type Interface struct {
// Name is the name of the interface
Name string `json:"name"`
// IPv4Network is the ipv4 address for the host
IPv4Network utils.Value[string] `json:"ipv4-network"`
// IPv6Network is the ipv6 address for the host
IPv6Network utils.Value[string] `json:"ipv6-network"`
// MacAddress is the mac address for the host
MacAddress utils.Value[string] `json:"macaddress"`
// IPv4 is the list of IPv4 addresses for the interface
IPv4 []string `json:"ipv4"`
// IPv4 is the list of IPv6 addresses for the interface
IPv6 []string `json:"ipv6"`
}
Interface holds information about a specific interface
Click to show internal directories.
Click to hide internal directories.