diff --git a/config.go b/config.go index d41cfde..b4c3f3c 100644 --- a/config.go +++ b/config.go @@ -13,6 +13,7 @@ import ( "time" ) +// Config represents full wg-quick like config structure type Config struct { wgtypes.Config @@ -106,7 +107,7 @@ AllowedIPs = {{ range $i, $el := .AllowedIPs }}{{if $i}}, {{ end }}{{ $el }}{{ e {{- end }} ` -// Parses base64 encoded wireguard private key +// ParseKey parses the base64 encoded wireguard private key func ParseKey(key string) (wgtypes.Key, error) { var pkey wgtypes.Key pkeySlice, err := base64.StdEncoding.DecodeString(key) diff --git a/wg.go b/wg.go index a207551..d137552 100644 --- a/wg.go +++ b/wg.go @@ -47,7 +47,7 @@ func Up(cfg *Config, iface string, logger logrus.FieldLogger) error { return nil } -// Down destroyes the wg interface. Mostly equivalent to `wg-quick down iface` +// Down destroys the wg interface. Mostly equivalent to `wg-quick down iface` func Down(cfg *Config, iface string, logger logrus.FieldLogger) error { log := logger.WithField("iface", iface) link, err := netlink.LinkByName(iface) @@ -224,7 +224,7 @@ func SyncAddress(cfg *Config, link netlink.Link, log logrus.FieldLogger) error { return nil } -// SyncAddress adds/deletes all route assigned IPV4 addressed as specified in the config +// SyncRoutes adds/deletes all route assigned IPV4 addressed as specified in the config func SyncRoutes(cfg *Config, link netlink.Link, log logrus.FieldLogger) error { routes, err := netlink.RouteList(link, syscall.AF_INET) if err != nil {