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

Function netCIDRContainsIPString

ext/network.go:391–399  ·  view source on GitHub ↗
(lhs, rhs ref.Val)

Source from the content-addressed store, hash-verified

389}
390
391func netCIDRContainsIPString(lhs, rhs ref.Val) ref.Val {
392 cidr := lhs.(CIDR)
393 s := rhs.(types.String)
394 addr, err := parseIPAddr(string(s))
395 if err != nil {
396 return types.WrapErr(err)
397 }
398 return types.Bool(cidr.Prefix.Contains(addr))
399}
400
401func netCIDRIP(val ref.Val) ref.Val {
402 cidr := val.(CIDR)

Callers

nothing calls this directly

Calls 4

WrapErrFunction · 0.92
BoolTypeAlias · 0.92
parseIPAddrFunction · 0.85
ContainsMethod · 0.65

Tested by

no test coverage detected