netio

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterfaceNil = errors.New("Interface is nil")

ErrInterfaceNil - errors out when interface is nil

View Source
var ErrMockNetIOFail = errors.New("netio fail")

ErrMockNetIOFail - mock netio error

Functions

This section is empty.

Types

type MockNetIO

type MockNetIO struct {
	// contains filtered or unexported fields
}

func NewMockNetIO

func NewMockNetIO(fail bool, failAttempt int) *MockNetIO

func (*MockNetIO) GetNetworkInterfaceAddrs

func (netshim *MockNetIO) GetNetworkInterfaceAddrs(iface *net.Interface) ([]net.Addr, error)

func (*MockNetIO) GetNetworkInterfaceByName

func (netshim *MockNetIO) GetNetworkInterfaceByName(name string) (*net.Interface, error)

func (*MockNetIO) SetGetInterfaceValidatonFn

func (netshim *MockNetIO) SetGetInterfaceValidatonFn(fn getInterfaceValidationFn)

type NetIO

type NetIO struct{}

func (*NetIO) GetNetworkInterfaceAddrs

func (ns *NetIO) GetNetworkInterfaceAddrs(iface *net.Interface) ([]net.Addr, error)

func (*NetIO) GetNetworkInterfaceByName

func (ns *NetIO) GetNetworkInterfaceByName(name string) (*net.Interface, error)

type NetIOInterface

type NetIOInterface interface {
	GetNetworkInterfaceByName(name string) (*net.Interface, error)
	GetNetworkInterfaceAddrs(iface *net.Interface) ([]net.Addr, error)
}

Jump to

Keyboard shortcuts

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