net

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	NICs []*NIC `json:"nics"`
	// contains filtered or unexported fields
}

func New

func New(opts ...*option.Option) (*Info, error)

New returns a pointer to an Info struct that contains information about the network interface controllers (NICs) on the host system

func (*Info) JSONString

func (i *Info) JSONString(indent bool) string

JSONString returns a string with the net information formatted as JSON under a top-level "net:" key

func (*Info) String

func (i *Info) String() string

func (*Info) YAMLString

func (i *Info) YAMLString() string

YAMLString returns a string with the net information formatted as YAML under a top-level "net:" key

type NIC

type NIC struct {
	Name                string           `json:"name"`
	MacAddress          string           `json:"mac_address"`
	IsVirtual           bool             `json:"is_virtual"`
	Capabilities        []*NICCapability `json:"capabilities"`
	PCIAddress          *string          `json:"pci_address,omitempty"`
	Speed               string           `json:"speed"`
	Duplex              string           `json:"duplex"`
	SupportedLinkModes  []string         `json:"supported_link_modes,omitempty"`
	SupportedPorts      []string         `json:"supported_ports,omitempty"`
	SupportedFECModes   []string         `json:"supported_fec_modes,omitempty"`
	AdvertisedLinkModes []string         `json:"advertised_link_modes,omitempty"`
	AdvertisedFECModes  []string         `json:"advertised_fec_modes,omitempty"`
}

func (*NIC) String

func (n *NIC) String() string

type NICCapability

type NICCapability struct {
	Name      string `json:"name"`
	IsEnabled bool   `json:"is_enabled"`
	CanEnable bool   `json:"can_enable"`
}

func (*NICCapability) String added in v0.11.0

func (nc *NICCapability) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL