wireguard

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package wireguard implements the Wireguard tunnels to be used as vpn technology to interconnect clusters.

Index

Constants

View Source
const (
	// Userspace implementation of wireguard.
	Userspace implementation = "userspace"
	// Kernel    implementation of wireguard.
	Kernel implementation = "kernel"
)

Variables

View Source
var (
	// WgUserImpl is the metric that reports if wireguard is running in userspace mode.
	WgUserImpl = prometheus.NewDesc(
		"liqo_wireguard_implementation",
		"Wireguard used implementation",
		[]string{metrics.MetricsLabels[0], implLabel},
		nil,
	)
)

Functions

func NewDriver

func NewDriver(k8sClient k8s.Interface, namespace string, config tunnel.Config) (tunnel.Driver, error)

NewDriver creates a new WireGuard driver.

Types

type ResolverFunc added in v0.3.0

type ResolverFunc func(address string) (*net.IPAddr, error)

ResolverFunc type of function that knows how to resolve an ip address belonging to ipv4 or ipv6 family.

type Wireguard added in v0.3.0

type Wireguard struct {
	metrics.Metrics

	Connchecker    *conncheck.ConnChecker
	Implementation implementation
	// contains filtered or unexported fields
}

Wireguard a wrapper for the wireguard device and its configuration.

func (*Wireguard) Close added in v0.3.0

func (w *Wireguard) Close() error

Close remove the wireguard device from the host.

func (*Wireguard) Collect added in v0.6.0

func (w *Wireguard) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Wireguard) ConnectToEndpoint added in v0.3.0

func (w *Wireguard) ConnectToEndpoint(tep *netv1alpha1.TunnelEndpoint, updateStatus conncheck.UpdateFunc) (*netv1alpha1.Connection, error)

ConnectToEndpoint connects to a remote cluster described by the given tep. updateStatusCallback is a function used by conncheck to update TunnelEndpoint connected status.

func (*Wireguard) Describe added in v0.7.1

func (w *Wireguard) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*Wireguard) DisconnectFromEndpoint added in v0.3.0

func (w *Wireguard) DisconnectFromEndpoint(tep *netv1alpha1.TunnelEndpoint) error

DisconnectFromEndpoint disconnects a remote cluster described by the given tep.

func (w *Wireguard) GetLink() netlink.Link

GetLink returns the netlink.Link referred to the wireguard device.

func (*Wireguard) Init added in v0.3.0

func (w *Wireguard) Init() error

Init initializes the Wireguard device.

func (*Wireguard) SetNewClient added in v0.3.0

func (w *Wireguard) SetNewClient() error

SetNewClient set a new client used to interact with the wireguard device.

Jump to

Keyboard shortcuts

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