MCPcopy Create free account
hub / github.com/PasarGuard/node / buildWGUserWithPeerIPs

Function buildWGUserWithPeerIPs

backend/wireguard/integration_e2e_test.go:238–254  ·  view source on GitHub ↗
(email, publicKey string, peerIPs []string, iface string, includeInterface bool)

Source from the content-addressed store, hash-verified

236}
237
238func buildWGUserWithPeerIPs(email, publicKey string, peerIPs []string, iface string, includeInterface bool) *common.User {
239 inbounds := []string{}
240 if includeInterface {
241 inbounds = []string{iface}
242 }
243
244 return &common.User{
245 Email: email,
246 Inbounds: inbounds,
247 Proxies: &common.Proxy{
248 Wireguard: &common.Wireguard{
249 PublicKey: publicKey,
250 PeerIps: append([]string(nil), peerIPs...),
251 },
252 },
253 }
254}
255
256func mustUserPeerIPByFamily(t *testing.T, wg *WireGuard, email string, wantIPv6 bool) string {
257 t.Helper()

Callers 2

buildWGUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected