Documentation

Index

Constants

View Source
const (
	// DefaultMTU is the default MTU for new bridge interfaces.
	DefaultMTU = 1500
)

Variables

View Source
var (
	// ErrIPAddrEmpty holds the error for when the ip address is empty.
	ErrIPAddrEmpty = errors.New("ip address cannot be empty")
	// ErrNameEmpty holds the error for when the name is empty.
	ErrNameEmpty = errors.New("name cannot be empty")
)

Functions

func Delete

func Delete(name string) error

Delete removes the bridge by the specified name.

func Init

func Init(opt Opt) (*net.Interface, error)

Init creates a bridge with the name specified if it does not exist.

Types

type Opt

type Opt struct {
	MTU    int
	IPAddr string
	Name   string
}

Opt holds the options for the bridge interface.

Source Files