types

package
v0.0.0-...-1ac23cf Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterface = "wg99"
)
View Source
const (
	KeyLength = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name      string
	Interface Interface
	Peers     []Peer
}

func (*Config) ToWgQuick

func (c *Config) ToWgQuick() string

func (*Config) WriteToFile

func (c *Config) WriteToFile(dir string) error

type Endpoint

type Endpoint struct {
	Host string
	Port uint16
}

func (*Endpoint) IsEmpty

func (e *Endpoint) IsEmpty() bool

func (*Endpoint) String

func (e *Endpoint) String() string

type IPNet

type IPNet struct {
	IP  net.IP
	Net uint8
}

func (*IPNet) String

func (r *IPNet) String() string

type Interface

type Interface struct {
	PrivateKey Key
	Addresses  []IPNet
	ListenPort uint16
	MTU        uint16
	DNS        []net.IP
	DNSSearch  []string
	PreUp      string
	PostUp     string
	PreDown    string
	PostDown   string
}

type Key

type Key [KeyLength]byte

func NewKey

func NewKey(bytes []byte) *Key

func NewPresharedKey

func NewPresharedKey() (*Key, error)

func NewPrivateKey

func NewPrivateKey() (*Key, error)

func (*Key) IsZero

func (k *Key) IsZero() bool

func (*Key) Public

func (k *Key) Public() *Key

func (*Key) String

func (k *Key) String() string

type Peer

type Peer struct {
	PublicKey           Key
	PresharedKey        Key
	AllowedIPs          []IPNet
	Endpoint            Endpoint
	PersistentKeepalive uint16
}

Jump to

Keyboard shortcuts

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