conf

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 20 Imported by: 6

Documentation

Index

Constants

View Source
const KeyLength = 32

Variables

This section is empty.

Functions

func DeleteName

func DeleteName(name string) error

func ListConfigNames

func ListConfigNames() ([]string, error)

func NameFromPath

func NameFromPath(path string) (string, error)

func PathIsEncrypted

func PathIsEncrypted(path string) bool

func ServiceNameOfTunnel added in v0.5.1

func ServiceNameOfTunnel(tunnelName string) (string, error)

func TunnelNameIsLess

func TunnelNameIsLess(a, b string) bool

func TunnelNameIsValid

func TunnelNameIsValid(name string) bool

Types

type Bytes

type Bytes uint64

func (Bytes) String

func (b Bytes) String() string

type Config

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

func FromDriverConfiguration added in v0.4.4

func FromDriverConfiguration(interfaze *driver.Interface, existingConfig *Config) *Config

func FromWgQuick

func FromWgQuick(s, name string) (*Config, error)

func FromWgQuickWithUnknownEncoding

func FromWgQuickWithUnknownEncoding(s, name string) (*Config, error)

func LoadFromName

func LoadFromName(name string) (*Config, error)

func LoadFromPath

func LoadFromPath(path string) (*Config, error)

func (*Config) DeduplicateNetworkEntries added in v0.1.0

func (conf *Config) DeduplicateNetworkEntries()

func (*Config) Delete

func (config *Config) Delete() error

func (*Config) IntersectsWith added in v0.4.4

func (conf *Config) IntersectsWith(other *Config) bool

func (*Config) Path

func (config *Config) Path() (string, error)

func (*Config) Redact added in v0.3.1

func (conf *Config) Redact()

func (*Config) Save

func (config *Config) Save(overwrite bool) error

func (*Config) ToDriverConfiguration added in v0.4.4

func (config *Config) ToDriverConfiguration() (*driver.Interface, uint32)

func (*Config) ToWgQuick

func (conf *Config) ToWgQuick() string

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 HandshakeTime

type HandshakeTime time.Duration

func (HandshakeTime) IsEmpty

func (t HandshakeTime) IsEmpty() bool

func (HandshakeTime) String

func (t HandshakeTime) String() string

type Interface

type Interface struct {
	PrivateKey Key
	Addresses  []netip.Prefix
	ListenPort uint16
	MTU        uint16
	DNS        []netip.Addr
	DNSSearch  []string
	PreUp      string
	PostUp     string
	PreDown    string
	PostDown   string
	TableOff   bool
}

type Key

type Key [KeyLength]byte

func NewPresharedKey

func NewPresharedKey() (*Key, error)

func NewPrivateKey

func NewPrivateKey() (*Key, error)

func NewPrivateKeyFromString

func NewPrivateKeyFromString(b64 string) (*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 ParseError

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

func (*ParseError) Error

func (e *ParseError) Error() string

type Peer

type Peer struct {
	PublicKey           Key
	PresharedKey        Key
	AllowedIPs          []netip.Prefix
	Endpoint            Endpoint
	PersistentKeepalive uint16

	RxBytes           Bytes
	TxBytes           Bytes
	LastHandshakeTime HandshakeTime
}

type StoreCallback

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

func RegisterStoreChangeCallback

func RegisterStoreChangeCallback(cb func()) *StoreCallback

func (*StoreCallback) Unregister

func (cb *StoreCallback) Unregister()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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