Documentation ¶
Index ¶
- Constants
- func GenKeyPair() (priv string, pub string, err error)
- func GenPSK() (psk string, err error)
- func Render(output Output, t Template, clusters map[string]*NetCluster) error
- func ValidateConf(config *Config, noKey bool) error
- type Cluster
- type Config
- type EdgeFunc
- type Forest
- func (f *Forest) AddDenseSubGraph(graphName string, nodes []string, applyOnPair EdgeFunc) error
- func (f *Forest) AddNodes(nodes []string)
- func (f *Forest) ForNodes(nodeFunc func(node string) error) error
- func (f *Forest) GetEdge(graphName string, nodeA, nodeB string) (string, bool)
- func (f *Forest) GetEdges(graphName string, node string) ([]string, bool)
- func (f *Forest) Len(graphName string) int
- type Graph
- type Host
- type NetCluster
- type Output
- type Template
- type WGInterface
- type WGPeer
Constants ¶
View Source
const WGKeyLen int = 32
WGKeyLen is the length of a Curve25519 key
Variables ¶
This section is empty.
Functions ¶
func GenKeyPair ¶
GenKeyPair generates a pair of base64 encoded Curve25519 keys
func Render ¶
func Render(output Output, t Template, clusters map[string]*NetCluster) error
Render applys templates on the data and export the result in output
func ValidateConf ¶
ValidateConf takes the json Config, validates some input and propagate parameters
Types ¶
type Config ¶
type Config struct { ConfigName string `json:"config-name"` IPv6Prefix string `json:"prefix-ipv6/cidr"` PersistentKeepalive *uint16 `json:"persistent-keepalive"` Iface string `json:"iface"` ListenPort uint16 `json:"port"` Hosts []*Host `json:"hosts"` HostsMap map[string]*Host `json:"-"` Clusters []*Cluster `json:"clusters"` Misc map[string]interface{} `json:"Misc"` }
type Forest ¶
Forest is a set of graph
func (*Forest) AddDenseSubGraph ¶
AddDenseSubGraph connects a subset of nodes a dense subgraph
type Host ¶
type Host struct { Name string `json:"host"` Templates []string `json:"templates"` Iface string `json:"iface"` PersistentKeepalive *uint16 `json:"persistent-keepalive"` ListenPort uint16 `json:"port"` PrivateIPv6 string `json:"-"` AllowedIPv6 []string `json:"-"` PrivateIPv6CIDR string `json:"ipv6"` PrivateKey string `json:"-"` PublicKey string `json:"public-key"` Misc map[string]interface{} `json:"Misc"` }
type NetCluster ¶
type NetCluster struct {
Ifaces map[string]*WGInterface
}
type Output ¶
type Output interface { AddFolder(name ...string) error AddEntry(name ...string) (io.WriteCloser, error) }
func NewDirOutput ¶
type Template ¶
func LoadTemplates ¶
LoadTemplates compiles all the available templates in a folder (not the subfolders) a template is a file with the extension .tmpl
type WGInterface ¶
Click to show internal directories.
Click to hide internal directories.