Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...InterfaceOption) (*Interface, error)
func (*Interface) GetHardwareAddr ¶
func (i *Interface) GetHardwareAddr() net.HardwareAddr
type InterfaceOption ¶
type InterfaceOption func(*Interface)
func WithCIDR ¶
func WithCIDR(cidr string) InterfaceOption
Option for IP address with mask, `10.58.0.1/24` by default
func WithDefaultGateway ¶
func WithDefaultGateway() InterfaceOption
Option for setting default gateway
func WithDevice ¶
func WithDevice(dev string) InterfaceOption
Option for network device, `tap_netstack` by deafult
func WithTimeout ¶
func WithTimeout(t time.Duration) InterfaceOption
Option to set timeout for read and write for interface
Click to show internal directories.
Click to hide internal directories.