gowired

package module
v0.0.0-...-ff59d1f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetEnv

func MustGetEnv(k string) string

Types

type DeviceConfig

type DeviceConfig struct {
	SecretKey string
	Endpoint  []netip.Addr
	Peers     []PeerConfig
	DNS       []netip.Addr
	MTU       int
}

DeviceConfig contains the information to initiate a wireguard connection

func GetDeviceConfig

func GetDeviceConfig() (*DeviceConfig, error)

type DeviceSetting

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

DeviceSetting contains the parameters for setting up a tun interface

type PeerConfig

type PeerConfig struct {
	PublicKey    string
	PreSharedKey string
	Endpoint     string
	KeepAlive    int
	AllowedIPs   []netip.Prefix
}

Configuration for a wireguard peer

type VirtualTun

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

VirtualTun stores a reference to netstack network and DNS configuration

func StartWireguard

func StartWireguard(conf *DeviceConfig) (*VirtualTun, error)

func (*VirtualTun) SetupForwarding

func (vt *VirtualTun) SetupForwarding() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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