Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶ added in v0.5.6
func Register(name string, ctor BackendCtor)
Types ¶
type Backend ¶
type Backend interface { // Called when the backend should create or begin managing a new network RegisterNetwork(ctx context.Context, wg *sync.WaitGroup, config *subnet.Config) (Network, error) }
Besides the entry points in the Backend interface, the backend's New() function receives static network interface information (like internal and external IP addresses, MTU, etc) which it should cache for later use if needed.
type BackendCtor ¶ added in v0.5.6
type BackendCtor func(sm subnet.Manager, ei *ExternalInterface) (Backend, error)
type ExternalInterface ¶ added in v0.5.6
type Manager ¶ added in v0.5.6
func NewManager ¶ added in v0.5.6
type RouteNetwork ¶ added in v0.10.0
type RouteNetwork struct { SimpleNetwork BackendType string SM subnet.Manager GetRoute func(lease *subnet.Lease) *netlink.Route Mtu int LinkIndex int // contains filtered or unexported fields }
func (*RouteNetwork) MTU ¶ added in v0.10.0
func (n *RouteNetwork) MTU() int
func (*RouteNetwork) Run ¶ added in v0.10.0
func (n *RouteNetwork) Run(ctx context.Context)
type SimpleNetwork ¶ added in v0.5.6
type SimpleNetwork struct { SubnetLease *subnet.Lease ExtIface *ExternalInterface }
func (*SimpleNetwork) Lease ¶ added in v0.5.6
func (n *SimpleNetwork) Lease() *subnet.Lease
func (*SimpleNetwork) MTU ¶ added in v0.5.6
func (n *SimpleNetwork) MTU() int
func (*SimpleNetwork) Run ¶ added in v0.5.6
func (_ *SimpleNetwork) Run(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.