wg

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	OverlayAddr       net.IPNet
	Port              int
	PrivKey           wgtypes.Key
	PubKey            wgtypes.Key
	KeepaliveInterval *time.Duration
	// contains filtered or unexported fields
}

State holds the configured state of a Wesher Wireguard interface

func New

func New(iface string, port int, ipnet *net.IPNet, name string, keepaliveInterval *time.Duration) (*State, *common.Node, error)

New creates a new Wesher Wireguard state The Wireguard keys are generated for every new interface The interface must later be setup using SetUpInterface

func (*State) DownInterface

func (s *State) DownInterface() error

DownInterface shuts down the associated network interface

func (*State) SetUpInterface

func (s *State) SetUpInterface(nodes []common.Node) error

SetUpInterface creates and sets up the associated network interface

Jump to

Keyboard shortcuts

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