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

Function netCIDRContainsIPString

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

Source from the content-addressed store, hash-verified

363}
364
365func netCIDRContainsIPString(lhs, rhs ref.Val) ref.Val {
366 cidr := lhs.(CIDR)
367 s := rhs.(types.String)
368 addr, err := parseIPAddr(string(s))
369 if err != nil {
370 return types.WrapErr(err)
371 }
372 return types.Bool(cidr.Prefix.Contains(addr))
373}
374
375func netCIDRIP(val ref.Val) ref.Val {
376 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