summaryrefslogtreecommitdiff
path: root/internal/wireguard/wireguard.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-12 19:18:05 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit74e36f0ead717105f26087c2cab08b41ba5a7ce8 (patch)
tree1eb2b7516bea705c9b5a50ce0965e170414ed880 /internal/wireguard/wireguard.go
parent682d70091af2044ff6d8b350da9dff13163232e2 (diff)
All: Document everything to pass revive lint
Diffstat (limited to 'internal/wireguard/wireguard.go')
-rw-r--r--internal/wireguard/wireguard.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/wireguard/wireguard.go b/internal/wireguard/wireguard.go
index af290ea..e94a485 100644
--- a/internal/wireguard/wireguard.go
+++ b/internal/wireguard/wireguard.go
@@ -36,12 +36,17 @@ func availableUDPPort() (int, error) {
return ludp.LocalAddr().(*net.UDPAddr).Port, nil
}
+// Proxy is the proxyguard information
type Proxy struct {
+ // SourcePort is the source port of the TCP socket
SourcePort int
- Listen string
- Peer string
+ // Listen is the IP:PORT of the udp listener
+ Listen string
+ // Peer is the hostname/ip:port of the WireGuard peer
+ Peer string
}
+// Config gets a wireguard config with API config `cfg`, wg key `key` and prefer tcp `tcp`
func Config(cfg string, key *wgtypes.Key, tcp bool) (string, *Proxy, error) {
// the key is nil if the client does not accept WireGuard
if key == nil {