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

Function parseIPAddr

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

Source from the content-addressed store, hash-verified

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