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
Is your feature request related to a problem? Please describe.
Since these structs could be used in configuration, should we add Validate functions to implement ConfigValidator? For NetAddr, for example, we could validate that Transport is one of "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and "unixpacket".
The text was updated successfully, but these errors were encountered:
**Description:**
Changes `Transport` from a `string` to a new `TransportType`. Implements
`UnmarshalText` for `TransportType` to enforce values.
This PR may be too much - it introduces a breaking change a lot of new
public APIs that may not be worth it for such a small module. If we
don't like the surface area this creates or the breaking change, but we
still want to enforce transport type values, I think implementing
`Validate` keeps the API footprint smaller and isn't breaking.
**Link to tracking Issue:** <Issue number if applicable>
Closes#9364
**Documentation:** <Describe the documentation added.>
Added godoc comments
---------
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Is your feature request related to a problem? Please describe.
Since these structs could be used in configuration, should we add
Validate
functions to implementConfigValidator
? ForNetAddr
, for example, we could validate thatTransport
is one of"tcp", "tcp4", "tcp6", "udp", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and "unixpacket"
.The text was updated successfully, but these errors were encountered: