You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a getter/ setter kind of config app for which I need to convert wgtypes.Peer to wgtypes.PeerConfig. I'm planning to write a helper function for that. If you guys are interested, I can make it a method of wgtypes.Peer and send a pull request instead.
I'm thinking of the following design:
// PeerConfig converts Peer into a config.
// Empty fields become nil in output, so those properties will not be reconfigured.
// Remove field in output is always false.
// ReplaceAllowedIPs configures the likewise named field in output.
func(p *Peer)PeerConfig(ReplaceAllowedIPs bool) PeerConfig
The text was updated successfully, but these errors were encountered:
I think at this time, I'd prefer to keep the API small and focused. In addition, I think some of the configuration structures could use some more work (see #7).
If this ends up being a popular request, I will reconsider though.
Ok. I already have the helper function in my project. Is was no biggie. The only two tests I had to do where for PresharedKey and PersistentKeepaliveInterval. The rest where already compatible types. Let me know whenever you change your mind.
I'm writing a getter/ setter kind of config app for which I need to convert
wgtypes.Peer
towgtypes.PeerConfig
. I'm planning to write a helper function for that. If you guys are interested, I can make it a method ofwgtypes.Peer
and send a pull request instead.I'm thinking of the following design:
The text was updated successfully, but these errors were encountered: