Documentation ¶
Index ¶
- Constants
- func ConvertStringToIPAddress(address string) net.IP
- func ConvertStringToIPNet(address string) (*net.IPNet, error)
- func ExecuteShellCommand(command string) error
- func GenerateAddress(subnet *net.IPNet, hostID net.IP) net.IP
- func GetLastRebootTime() (time.Time, error)
- func GetOSInfo() string
- type AddressFamily
Constants ¶
View Source
const ( // CNMRuntimePath is the path where CNM state files are stored. CNMRuntimePath = "/var/lib/azure-network/" // CNIRuntimePath is the path where CNM state files are stored. CNIRuntimePath = "/var/run/" // LogPath is the path where log files are stored. LogPath = "/var/log/" )
Variables ¶
This section is empty.
Functions ¶
func ConvertStringToIPAddress ¶
ConvertStringToIPAddress converts the given IP address string to a net.IP object. The input string can be in regular dotted notation or CIDR notation.
func ConvertStringToIPNet ¶
ConvertStringToIPNet converts the given IP address string to a net.IPNet object.
func ExecuteShellCommand ¶ added in v1.0.0
ExecuteShellCommand executes a shell command.
func GenerateAddress ¶
GenerateAddress generates an IP address from the given network and host ID.
func GetLastRebootTime ¶ added in v1.0.0
GetLastRebootTime returns the last time the system rebooted.
Types ¶
type AddressFamily ¶
type AddressFamily int
AddressFamily specifies a protocol address family number.
const ( AfUnspec AddressFamily = 0 AfINET AddressFamily = 0x2 AfINET6 AddressFamily = 0xa )
func GetAddressFamily ¶
func GetAddressFamily(address *net.IP) AddressFamily
GetAddressFamily returns the address family of an IP address.
Click to show internal directories.
Click to hide internal directories.