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

Function clonePeerInfo

backend/wireguard/config.go:43–53  ·  view source on GitHub ↗
(peer *PeerInfo)

Source from the content-addressed store, hash-verified

41}
42
43func clonePeerInfo(peer *PeerInfo) *PeerInfo {
44 if peer == nil {
45 return nil
46 }
47
48 return &PeerInfo{
49 Email: peer.Email,
50 PublicKey: peer.PublicKey,
51 AllowedIPs: append([]net.IPNet(nil), peer.AllowedIPs...),
52 }
53}
54
55// NewConfig creates a new WireGuard configuration from JSON
56func NewConfig(config string) (*Config, error) {

Callers 6

InitMethod · 0.85
ApplyChangesMethod · 0.85
ReplaceAllMethod · 0.85
GetByEmailMethod · 0.85
GetByKeyMethod · 0.85
GetAllMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected