(publicKey wgtypes.Key, allowedIPs []net.IPNet, presharedKey *wgtypes.Key)
| 18 | ) |
| 19 | |
| 20 | func buildAddConfig(publicKey wgtypes.Key, allowedIPs []net.IPNet, presharedKey *wgtypes.Key) wgtypes.PeerConfig { |
| 21 | config := wgtypes.PeerConfig{ |
| 22 | PublicKey: publicKey, |
| 23 | AllowedIPs: allowedIPs, |
| 24 | PersistentKeepaliveInterval: keepAlive, |
| 25 | } |
| 26 | if presharedKey != nil { |
| 27 | config.PresharedKey = presharedKey |
| 28 | } |
| 29 | return config |
| 30 | } |
| 31 | |
| 32 | func buildRemoveConfig(publicKey wgtypes.Key) wgtypes.PeerConfig { |
| 33 | return wgtypes.PeerConfig{PublicKey: publicKey, Remove: true} |
no outgoing calls
no test coverage detected