-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ipcidr support #177
Add ipcidr support #177
Conversation
transcoders.go
Outdated
@@ -54,6 +54,15 @@ func (t twrp) ValidateBytes(b []byte) error { | |||
var TranscoderIP4 = NewTranscoderFromFunctions(ip4StB, ip4BtS, nil) | |||
var TranscoderIP6 = NewTranscoderFromFunctions(ip6StB, ip6BtS, nil) | |||
var TranscoderIP6Zone = NewTranscoderFromFunctions(ip6zoneStB, ip6zoneBtS, ip6zoneVal) | |||
var TranscoderIPCIDR = NewTranscoderFromFunctions(func(s string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the convention here was to define separate functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if there's a specific reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, module one defensive check.
@marten-seemann can you merge please? I don’t have access |
Adds the
ipcidr
protocol.Example:
/ip4/1.2.3.0/ipcidr/24
Can be used by ipv6 as well