wgutils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair() (privateKey string, publicKey string, err error)

func GenerateWireguardConfig

func GenerateWireguardConfig(wgParams WgConfigParams) (string, error)

Types

type PrivatePeer

type PrivatePeer struct {
	// displayname is used in comment for the specified peer
	DisplayName string

	PublicKey  string
	AllowedIPs []string
}

type PublicPeer

type PublicPeer struct {
	// displayname is used in comment for the specified peer
	DisplayName string

	PublicKey  string
	AllowedIPs []string
	Endpoint   string
}

type WgConfigParams

type WgConfigParams struct {
	IPAddr     string
	PrivateKey string
	ListenPort uint16

	DNS     string
	WithDNS bool

	PostUp   []string
	PostDown []string

	PublicPeers  []PublicPeer
	PrivatePeers []PrivatePeer
}

Jump to

Keyboard shortcuts

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