Add Wireguard Config

This commit is contained in:
Samuel Lorch 2023-05-06 21:13:44 +02:00
parent 5bf336ff91
commit a67911df67
5 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,9 @@
package vpn
type WireguardInterface struct {
PublicKey string `json:"public_key"`
PrivateKey string `json:"private_key"`
ListenPort uint64 `json:"listen_port"`
Peers []string `json:"peers"`
Comment string `json:"comment,omitempty"`
}

View file

@ -0,0 +1,10 @@
package vpn
type WireguardPeer struct {
PublicKey string `json:"public_key"`
PresharedKey *string `json:"preshared_key,omitempty"`
AllowedIPs []string `json:"allowed_ips"`
Endpoint *string `json:"endpoint,omitempty"`
PersistentKeepalive *uint64 `json:"persistent_keepalive,omitempty"`
Comment string `json:"comment,omitempty"`
}

View file

@ -0,0 +1,5 @@
package vpn
type VPN struct {
Wireguard Wireguard `json:"wireguard" validate:"required,dive"`
}

View file

@ -0,0 +1,6 @@
package vpn
type Wireguard struct {
Interfaces map[string]WireguardInterface `json:"interfaces" validate:"required,dive"`
Peers map[string]WireguardPeer `json:"peers" validate:"required,dive"`
}