Documentation ¶
Index ¶
- Variables
- func IPAddressEnvOption() cel.EnvOption
- type IPAddress
- func (ip *IPAddress) CompileOptions() []cel.EnvOption
- func (ip IPAddress) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (ip IPAddress) ConvertToType(typeValue ref.Type) ref.Val
- func (ip IPAddress) Equal(other ref.Val) ref.Val
- func (ip *IPAddress) ProgramOptions() []cel.ProgramOption
- func (ip IPAddress) Type() ref.Type
- func (ip IPAddress) Value() any
- type ParameterType
Constants ¶
This section is empty.
Variables ¶
var ( AnyParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_ANY, cel.AnyType, anyTypeConverterFunc, ) BoolParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_BOOL, cel.BoolType, primitiveTypeConverterFunc[bool], ) StringParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_STRING, cel.StringType, primitiveTypeConverterFunc[string], ) IntParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_INT, cel.IntType, numericTypeConverterFunc[int64], ) UIntParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_UINT, cel.UintType, numericTypeConverterFunc[uint64], ) DoubleParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_DOUBLE, cel.DoubleType, numericTypeConverterFunc[float64], ) DurationParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_DURATION, cel.DurationType, durationTypeConverterFunc, ) TimestampParamType = registerParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_TIMESTAMP, cel.TimestampType, timestampTypeConverterFunc, ) MapParamType = registerParamTypeWithGenerics( openfgav1.ConditionParamTypeRef_TYPE_NAME_MAP, startingGenericTypeCount, mapTypeConverterFunc, ) ListParamType = registerParamTypeWithGenerics( openfgav1.ConditionParamTypeRef_TYPE_NAME_LIST, startingGenericTypeCount, listTypeConverterFunc, ) )
var CustomParamTypes = map[openfgav1.ConditionParamTypeRef_TypeName][]cel.EnvOption{}
var IPAddressType = registerCustomParamType( openfgav1.ConditionParamTypeRef_TYPE_NAME_IPADDRESS, cel.ObjectType("IPAddress"), ipaddressTypeConverterFunc, cel.Function("in_cidr", cel.MemberOverload("ipaddr_in_cidr", []*cel.Type{cel.ObjectType("IPAddress"), cel.StringType}, cel.BoolType, cel.BinaryBinding(ipaddressCELBinaryBinding), ), ), )
IPAddressType defines a ParameterType that is used to represent IP addresses in CEL expressions.
Functions ¶
func IPAddressEnvOption ¶
Types ¶
type IPAddress ¶
type IPAddress struct {
// contains filtered or unexported fields
}
IPAddress represents a network IP address.
func ParseIPAddress ¶
ParseIPAddress attempts to parse the provided ip string. If the provided string does not define a well-formed IP address, then an error is returned.
func (*IPAddress) CompileOptions ¶
func (IPAddress) ConvertToNative ¶
ConvertToNative implements the CEL ref.Val.ConvertToNative.
See https://pkg.go.dev/github.com/google/cel-go/common/types/ref#Val
func (IPAddress) ConvertToType ¶
ConvertToType implements the CEL ref.Val.ConvertToType.
See https://pkg.go.dev/github.com/google/cel-go/common/types/ref#Val
func (IPAddress) Equal ¶
Equal implements the CEL ref.Val.Equal.
See https://pkg.go.dev/github.com/google/cel-go/common/types/ref#Val
func (*IPAddress) ProgramOptions ¶
func (ip *IPAddress) ProgramOptions() []cel.ProgramOption
func (IPAddress) Type ¶
Type implements the CEL ref.Val.Type.
See https://pkg.go.dev/github.com/google/cel-go/common/types/ref#Val
func (IPAddress) Value ¶
Value implements ref.Val.Value.
See https://pkg.go.dev/github.com/google/cel-go/common/types/ref#Val
type ParameterType ¶
type ParameterType struct {
// contains filtered or unexported fields
}
ParameterType defines the canonical representation of parameter types supported in conditions.
func DecodeParameterType ¶
func DecodeParameterType(conditionParamType *openfgav1.ConditionParamTypeRef) (*ParameterType, error)
func NewParameterType ¶
func NewParameterType( name openfgav1.ConditionParamTypeRef_TypeName, celType *cel.Type, generics []ParameterType, typedParamConverter typedParamValueConverter, ) ParameterType
func (ParameterType) CelType ¶
func (pt ParameterType) CelType() *cel.Type
CelType returns the underlying Google CEL type for the variable type.
func (ParameterType) ConvertValue ¶
func (pt ParameterType) ConvertValue(value any) (any, error)
func (ParameterType) String ¶
func (pt ParameterType) String() string