MCPcopy Create free account
hub / github.com/cel-expr/cel-go / parseIPAddr

Function parseIPAddr

ext/network.go:519–531  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

517}
518
519func parseIPAddr(raw string) (netip.Addr, error) {
520 addr, err := netip.ParseAddr(raw)
521 if err != nil {
522 return netip.Addr{}, fmt.Errorf("IP Address %q parse error during conversion from string: %v", raw, err)
523 }
524 if addr.Zone() != "" {
525 return netip.Addr{}, fmt.Errorf("IP address %q with zone value is not allowed", raw)
526 }
527 if addr.Is4In6() {
528 return netip.Addr{}, fmt.Errorf("IPv4-mapped IPv6 address %q is not allowed", raw)
529 }
530 return addr, nil
531}
532
533// IP represents an IP address type.
534type IP struct {

Callers 5

netCIDRContainsIPStringFunction · 0.85
netIPIsCanonicalFunction · 0.85
netIPStringFunction · 0.85
netIsIPFunction · 0.85
checkIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected