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

Function netCIDRContainsIPString

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

Source from the content-addressed store, hash-verified

336}
337
338func netCIDRContainsIPString(lhs, rhs ref.Val) ref.Val {
339 cidr := lhs.(CIDR)
340 s := rhs.(types.String)
341 addr, err := parseIPAddr(string(s))
342 if err != nil {
343 return types.WrapErr(err)
344 }
345 return types.Bool(cidr.Prefix.Contains(addr))
346}
347
348func netCIDRIP(val ref.Val) ref.Val {
349 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