nr

package
v0.2.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetResource

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

NetResource holds the logic to configure an network resource

func New

func New(networkID pkg.NetID, netResource *pkg.NetResource, ipRange *net.IPNet) (*NetResource, error)

New creates a new NetResource object

func (*NetResource) BridgeName

func (nr *NetResource) BridgeName() (string, error)

BridgeName returns the name of the bridge to create for the network resource in the host network namespace

func (*NetResource) ConfigureWG

func (nr *NetResource) ConfigureWG(privateKey string) error

ConfigureWG sets the routes and IP addresses on the wireguard interface of the network resources

func (*NetResource) Create

func (nr *NetResource) Create(pubNS ns.NetNS) error

Create setup the basic components of the network resource network namespace, bridge, wireguard interface and veth pair

func (*NetResource) Delete

func (nr *NetResource) Delete() error

Delete removes all the interfaces and namespaces created by the Create method

func (*NetResource) ID

func (nr *NetResource) ID() string

ID returns the network ID in which the NetResource is defined

func (*NetResource) Join

func (nr *NetResource) Join(containerID string, addrs []net.IP, publicIP6 bool) (join pkg.Member, err error)

Join make a network namespace of a container join a network resource network

func (*NetResource) Leave

func (nr *NetResource) Leave(containerID string) error

Leave delete a container network namespace

func (*NetResource) NRIface

func (nr *NetResource) NRIface() (string, error)

NRIface returns name of netresource local interface

func (*NetResource) Namespace

func (nr *NetResource) Namespace() (string, error)

Namespace returns the name of the network namespace to create for the network resource

func (*NetResource) String

func (nr *NetResource) String() string

func (*NetResource) WGName

func (nr *NetResource) WGName() (string, error)

WGName returns the name of the wireguard interface to create for the network resource

Jump to

Keyboard shortcuts

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