Categorygithub.com/uinta-labs/wg-quick-go
modulepackage
0.1.4
Repository: https://github.com/uinta-labs/wg-quick-go.git
Documentation: pkg.go.dev

# README

wg-quick-go

Build Status GoDoc Go Report Card

wg-quick like library in go for embedding

Roadmap

  • full wg-quick feature parity
    • PreUp
    • PostUp
    • PreDown
    • PostDown
    • DNS
    • MTU
    • Save --> Use MarshallText interface to save config
  • Sync
  • Up
  • Down
  • MarshallText
  • UnmarshallText
  • Minimal test
  • Integration tests ((TODO; have some virtual machines/kvm and wreck havoc :) ))

Caveats

  • Endpoints DNS MarshallText is unsupported
  • Pre/Post Up/Down doesn't support escaped %i, that is all %i are expanded to interface name.
  • SaveConfig in config is only a placeholder (( since there's no reading/writing from files )). Use Unmarshall/Marshall Text to save/load config (( you're responsible for IO)).

# Packages

No description provided by the author

# Functions

Down destroys the wg interface.
ParseKey parses the base64 encoded wireguard private key.
Sync the config to the current setup for given interface It perform 4 operations: * SyncLink --> makes sure link is up and type wireguard * SyncWireguardDevice --> configures allowedIP & other wireguard specific settings * SyncAddress --> synces linux addresses bounded to this interface * SyncRoutes --> synces all allowedIP routes to route to this interface.
SyncAddress adds/deletes all lind assigned IPV4 addressed as specified in the config.
SyncLink synces link state with the config.
SyncRoutes adds/deletes all route assigned IPV4 addressed as specified in the config.
SyncWireguardDevice synces wireguard vpn setting on the given link.
Up sets and configures the wg interface.

# Structs

Config represents full wg-quick like config structure.