network

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePEM added in v0.3.1

func DecodePEM(pemBytes []byte) ([]*x509.Certificate, error)

func ForEachInterface

func ForEachInterface(f func(link netlink.Link) error) error

ForEachInterface runs a callback on all non-loopback interfaces

func GetDeviceDuplex

func GetDeviceDuplex(device string) string

func GetDeviceSpeed

func GetDeviceSpeed(device string) string

func GetHardwareAddr

func GetHardwareAddr(s string) *net.HardwareAddr

func GetInterfaceName

func GetInterfaceName(mac *net.HardwareAddr) string

func NewClient added in v0.3.1

func NewClient(rootFile string) (http.Client, error)

NewClient configures an HTTP client in the same way that stboot does. The root file needs to contain one or more X.509 certificates in PEM format. These certificates are used as trust anchors while constructing chains.

func ResetInterfaces

func ResetInterfaces() error

func TestInterfaces

func TestInterfaces(gw, addr string, interfaceWait time.Duration) ([]netlink.Link, error)

func WaitForDeviceEvent

func WaitForDeviceEvent(ctx context.Context, iface string, state netlink.LinkOperState) error

Types

type Pinger

type Pinger struct {
	*ping.Pinger
	// contains filtered or unexported fields
}

func NewPinger

func NewPinger(addr string) (*Pinger, error)

func (*Pinger) Run

func (p *Pinger) Run(ctx context.Context) error

func (*Pinger) Stop

func (p *Pinger) Stop()

Jump to

Keyboard shortcuts

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