cmd

package
v0.0.0-...-32219d9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func FatalOnError

func FatalOnError(error error)

func GenerateClientConf

func GenerateClientConf(client Client, nodes []clustermanager.Node) string

func GenerateKeyPairs

func GenerateKeyPairs(node clustermanager.Node, count int) []clustermanager.WgKeyPair

func GenerateWireguardConf

func GenerateWireguardConf(node clustermanager.Node, nodes []clustermanager.Node, clients []Client) string

Types

type Client

type Client struct {
	Name    string                   `json:"name"`
	Address string                   `json:"address"`
	CIDR    string                   `json:"cidr"`
	KeyPair clustermanager.WgKeyPair `json:"key_pair"`
}

type Config

type Config struct {
	Name    string                  `json:"name"`
	Nodes   []clustermanager.Node   `json:"nodes"`
	Clients []Client                `json:"clients"`
	SSHKeys []clustermanager.SSHKey `json:"ssh_keys"`
}

func (*Config) SetupEncryptedNetwork

func (config *Config) SetupEncryptedNetwork(configNumber int, dryRun bool) error

type WgCtlContext

type WgCtlContext struct {
	Config *Config
	// contains filtered or unexported fields
}

func (*WgCtlContext) IsConfigLoaded

func (ctx *WgCtlContext) IsConfigLoaded() bool

func (*WgCtlContext) LoadFromLocalDir

func (ctx *WgCtlContext) LoadFromLocalDir() (bool, error)

LoadFromLocalDir tries to load the config from local dir. returns true if found and loaded, otherwise false false does not mean an error exists. If no config was found, it returns false and no error

func (*WgCtlContext) SSH

func (*WgCtlContext) SaveConfig

func (ctx *WgCtlContext) SaveConfig() error

Jump to

Keyboard shortcuts

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