wg

package
v0.0.0-...-314436a Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Run(context.Context) error
	AnnounceInfo() networkstate.WireguardState
	Update()
}

func New

func New(cfg *config.Config, state *networkstate.State) (Adapter, 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.

type State

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

State holds the configured state of a Wesher Wireguard interface.

func (*State) AnnounceInfo

func (s *State) AnnounceInfo() networkstate.WireguardState

func (*State) InterfaceDown

func (s *State) InterfaceDown() error

InterfaceDown shuts down the associated network interface.

func (*State) InterfaceUp

func (s *State) InterfaceUp() error

InterfaceUp creates the interface and routes to the overlay network

func (*State) Run

func (s *State) Run(ctx context.Context) error

func (State) Update

func (s State) Update()

func (*State) UpdatePeers

func (s *State) UpdatePeers() error

UpdatePeers updates the peers configuration

Jump to

Keyboard shortcuts

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