agent

package
v0.0.0-...-e5bad9c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent creates a WireGuard interface, advertises it in the registry, and manages relationships with its peers.

func NewAgent

func NewAgent(name string, optionFuncs ...OptionFunc) (*Agent, error)

NewAgent creates an agent to manage a local WireGuard peer.

func (*Agent) Close

func (a *Agent) Close() error

Close shuts down and cleans up the agent.

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

Run ...

type OptionFunc

type OptionFunc func(*options) error

OptionFunc describes the function signature for methods which modify the agentOptions.

func WithEndpointAddr

func WithEndpointAddr(endpointAddr string) OptionFunc

WithEndpointAddr ...

func WithIPs

func WithIPs(ips []string) OptionFunc

WithIPs sets a list of IP addresses to add to the WireGuard interface.

func WithKeepAliveDuration

func WithKeepAliveDuration(keepalive time.Duration) OptionFunc

WithKeepAliveDuration sets the minimum keep-alive duration which this node should use when communicating with peers.

func WithKubeNode

func WithKubeNode(kubeNode string) OptionFunc

WithKubeNode sets the name of this kubernetes node.

func WithLabels

func WithLabels(labels labels.Set) OptionFunc

WithLabels sets the labels for this peer.

func WithLocalKubeClientConfig

func WithLocalKubeClientConfig(config clientcmd.ClientConfig) OptionFunc

WithLocalKubeClientConfig sets the config for the local kubernetes cluster. This is used to retrieve info about the local node, pod, and services. If no registry kubeconfig is specified, this config will also be used to register this peer and discover others.

func WithLogger

func WithLogger(ll log.FieldLogger) OptionFunc

WithLogger sets a logger on the agent options.

func WithOfferRoutes

func WithOfferRoutes(offerRoutes []string) OptionFunc

WithOfferRoutes sets a list of CIDR style routes which we should offer to peers.

func WithPeerSelector

func WithPeerSelector(peerSelector labels.Selector) OptionFunc

WithPeerSelector is a label selector which sets the list of peers we will add to the WireGuard interface. This can be used to exclude peers we have local connectivty with.

func WithRegistryKubeClientConfig

func WithRegistryKubeClientConfig(config clientcmd.ClientConfig) OptionFunc

WithRegistryKubeClientConfig sets the config for the wgmesh registry, which is used to register this peer and discover others.

func WithRegistryNamespace

func WithRegistryNamespace(registryNamespace string) OptionFunc

WithRegistryNamespace sets the namespace for the registry.

func WithWireGuardInterfaceOptions

func WithWireGuardInterfaceOptions(wgIfaceOptions *interfaces.WireGuardInterfaceOptions) OptionFunc

WithWireGuardInterfaceOptions sets parameters used to create/reuse a WireGuard network interface.

Jump to

Keyboard shortcuts

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