Documentation ¶
Index ¶
- func Execute()
- func FatalOnError(error error)
- func GenerateClientConf(client Client, nodes []clustermanager.Node) string
- func GenerateKeyPairs(node clustermanager.Node, count int) []clustermanager.WgKeyPair
- func GenerateWireguardConf(node clustermanager.Node, nodes []clustermanager.Node, clients []Client) string
- type Client
- type Config
- type WgCtlContext
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"` }
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 (ctx *WgCtlContext) SSH() *clustermanager.SSHCommunicator
func (*WgCtlContext) SaveConfig ¶
func (ctx *WgCtlContext) SaveConfig() error
Click to show internal directories.
Click to hide internal directories.