Versions in this module Expand all Collapse all v0 v0.3.1 Nov 14, 2023 v0.3.0 Mar 30, 2023 Changes in this version + var E_Field = &file_validate_validate_proto_extTypes[4] + var E_File = &file_validate_validate_proto_extTypes[0] + var E_Message = &file_validate_validate_proto_extTypes[3] + var E_Method = &file_validate_validate_proto_extTypes[2] + var E_Service = &file_validate_validate_proto_extTypes[1] + var File_validate_validate_proto protoreflect.FileDescriptor + var Options_Overloads_Type_Primitive_name = map[int32]string + var Options_Overloads_Type_Primitive_value = map[string]int32 + func BuildEnvOption(options *Options, descs ...protoreflect.MessageDescriptor) cel.EnvOption + func BuildMacros(options *Options, expr string, envOpts []cel.EnvOption) ([]parser.Macro, error) + func GenerateResourceTypePatternMapping(desc protoreflect.Descriptor) map[string]string + func GetExtension(m protoreflect.ProtoMessage, xt protoreflect.ExtensionType) interface + func IsDefaultValue(m proto.Message, fdesc protoreflect.FieldDescriptor) bool + func LoadLibrary(pattern string, lib cel.Library) error + func TypeFromOverloadType(t *Options_Overloads_Type) *v1alpha1.Type + type Configuration struct + RequiredSupportDisabled bool + ResourceReferenceSupportDisabled bool + Rule *FileRule + func (*Configuration) Descriptor() ([]byte, []int) + func (*Configuration) ProtoMessage() + func (x *Configuration) GetRequiredSupportDisabled() bool + func (x *Configuration) GetResourceReferenceSupportDisabled() bool + func (x *Configuration) GetRule() *FileRule + func (x *Configuration) ProtoReflect() protoreflect.Message + func (x *Configuration) Reset() + func (x *Configuration) String() string + type FieldRule struct + Required bool + Rule *Rule + func (*FieldRule) Descriptor() ([]byte, []int) + func (*FieldRule) ProtoMessage() + func (x *FieldRule) GetRequired() bool + func (x *FieldRule) GetRule() *Rule + func (x *FieldRule) ProtoReflect() protoreflect.Message + func (x *FieldRule) Reset() + func (x *FieldRule) String() string + type FieldRuleValidater interface + IsRequired func() bool + Validater func() RuleValidater + type FileRule struct + MessageRules map[string]*MessageRule + Options *Options + ServiceRules map[string]*ServiceRule + func (*FileRule) Descriptor() ([]byte, []int) + func (*FileRule) ProtoMessage() + func (x *FileRule) GetMessageRules() map[string]*MessageRule + func (x *FileRule) GetOptions() *Options + func (x *FileRule) GetServiceRules() map[string]*ServiceRule + func (x *FileRule) ProtoReflect() protoreflect.Message + func (x *FileRule) Reset() + func (x *FileRule) String() string + type Library struct + EnvOpts []cel.EnvOption + PgrOpts []cel.ProgramOption + func (l *Library) CompileOptions() []cel.EnvOption + func (l *Library) ProgramOptions() []cel.ProgramOption + type Manager struct + func NewManager(file protoreflect.FileDescriptor, opts ...ManagerOption) (*Manager, error) + func (m *Manager) BuildValidaters() error + func (m *Manager) GetMessageRuleValidater(desc protoreflect.MessageDescriptor) (MessageRuleValidater, error) + func (m *Manager) GetServiceRuleValidater(desc protoreflect.ServiceDescriptor) (ServiceRuleValidater, error) + func (m *Manager) LoadLibrary(lib cel.Library) error + type ManagerOption interface + func WithConfiguration(cfgList ...*Configuration) ManagerOption + func WithFallbackOverloads() ManagerOption + type MessageRule struct + FieldRules map[string]*FieldRule + Options *Options + Rule *Rule + func (*MessageRule) Descriptor() ([]byte, []int) + func (*MessageRule) ProtoMessage() + func (x *MessageRule) GetFieldRules() map[string]*FieldRule + func (x *MessageRule) GetOptions() *Options + func (x *MessageRule) GetRule() *Rule + func (x *MessageRule) ProtoReflect() protoreflect.Message + func (x *MessageRule) Reset() + func (x *MessageRule) String() string + type MessageRuleValidater interface + HasValidaters func() bool + ValidateWithMask func(ctx context.Context, m proto.Message, fm *fieldmaskpb.FieldMask) error + type MethodRule struct + Rule *Rule + func (*MethodRule) Descriptor() ([]byte, []int) + func (*MethodRule) ProtoMessage() + func (x *MethodRule) GetRule() *Rule + func (x *MethodRule) ProtoReflect() protoreflect.Message + func (x *MethodRule) Reset() + func (x *MethodRule) String() string + type MethodRuleValidater interface + Validater func() RuleValidater + type Options struct + Globals *Options_Globals + Overloads *Options_Overloads + StdlibOverridingEnabled bool + func (*Options) Descriptor() ([]byte, []int) + func (*Options) ProtoMessage() + func (x *Options) GetGlobals() *Options_Globals + func (x *Options) GetOverloads() *Options_Overloads + func (x *Options) GetStdlibOverridingEnabled() bool + func (x *Options) ProtoReflect() protoreflect.Message + func (x *Options) Reset() + func (x *Options) String() string + type Options_Globals struct + Constants map[string]string + Functions map[string]string + func (*Options_Globals) Descriptor() ([]byte, []int) + func (*Options_Globals) ProtoMessage() + func (x *Options_Globals) GetConstants() map[string]string + func (x *Options_Globals) GetFunctions() map[string]string + func (x *Options_Globals) ProtoReflect() protoreflect.Message + func (x *Options_Globals) Reset() + func (x *Options_Globals) String() string + type Options_Overloads struct + Functions map[string]*Options_Overloads_Function + Variables map[string]*Options_Overloads_Type + func (*Options_Overloads) Descriptor() ([]byte, []int) + func (*Options_Overloads) ProtoMessage() + func (x *Options_Overloads) GetFunctions() map[string]*Options_Overloads_Function + func (x *Options_Overloads) GetVariables() map[string]*Options_Overloads_Type + func (x *Options_Overloads) ProtoReflect() protoreflect.Message + func (x *Options_Overloads) Reset() + func (x *Options_Overloads) String() string + type Options_Overloads_Function struct + Args []*Options_Overloads_Type + Result *Options_Overloads_Type + func (*Options_Overloads_Function) Descriptor() ([]byte, []int) + func (*Options_Overloads_Function) ProtoMessage() + func (x *Options_Overloads_Function) GetArgs() []*Options_Overloads_Type + func (x *Options_Overloads_Function) GetResult() *Options_Overloads_Type + func (x *Options_Overloads_Function) ProtoReflect() protoreflect.Message + func (x *Options_Overloads_Function) Reset() + func (x *Options_Overloads_Function) String() string + type Options_Overloads_Type struct + Type isOptions_Overloads_Type_Type + func (*Options_Overloads_Type) Descriptor() ([]byte, []int) + func (*Options_Overloads_Type) ProtoMessage() + func (m *Options_Overloads_Type) GetType() isOptions_Overloads_Type_Type + func (x *Options_Overloads_Type) GetArray() *Options_Overloads_Type_Array + func (x *Options_Overloads_Type) GetMap() *Options_Overloads_Type_Map + func (x *Options_Overloads_Type) GetObject() string + func (x *Options_Overloads_Type) GetPrimitive() Options_Overloads_Type_Primitive + func (x *Options_Overloads_Type) ProtoReflect() protoreflect.Message + func (x *Options_Overloads_Type) Reset() + func (x *Options_Overloads_Type) String() string + type Options_Overloads_Type_Array struct + Type *Options_Overloads_Type + func (*Options_Overloads_Type_Array) Descriptor() ([]byte, []int) + func (*Options_Overloads_Type_Array) ProtoMessage() + func (x *Options_Overloads_Type_Array) GetType() *Options_Overloads_Type + func (x *Options_Overloads_Type_Array) ProtoReflect() protoreflect.Message + func (x *Options_Overloads_Type_Array) Reset() + func (x *Options_Overloads_Type_Array) String() string + type Options_Overloads_Type_Array_ struct + Array *Options_Overloads_Type_Array + type Options_Overloads_Type_Map struct + Key *Options_Overloads_Type + Value *Options_Overloads_Type + func (*Options_Overloads_Type_Map) Descriptor() ([]byte, []int) + func (*Options_Overloads_Type_Map) ProtoMessage() + func (x *Options_Overloads_Type_Map) GetKey() *Options_Overloads_Type + func (x *Options_Overloads_Type_Map) GetValue() *Options_Overloads_Type + func (x *Options_Overloads_Type_Map) ProtoReflect() protoreflect.Message + func (x *Options_Overloads_Type_Map) Reset() + func (x *Options_Overloads_Type_Map) String() string + type Options_Overloads_Type_Map_ struct + Map *Options_Overloads_Type_Map + type Options_Overloads_Type_Object struct + Object string + type Options_Overloads_Type_Primitive int32 + const Options_Overloads_Type_ANY + const Options_Overloads_Type_BOOL + const Options_Overloads_Type_BYTES + const Options_Overloads_Type_DOUBLE + const Options_Overloads_Type_DURATION + const Options_Overloads_Type_DYN + const Options_Overloads_Type_ERROR + const Options_Overloads_Type_INT + const Options_Overloads_Type_PRIMITIVE_UNSPECIFIED + const Options_Overloads_Type_STRING + const Options_Overloads_Type_TIMESTAMP + const Options_Overloads_Type_UINT + func (Options_Overloads_Type_Primitive) Descriptor() protoreflect.EnumDescriptor + func (Options_Overloads_Type_Primitive) EnumDescriptor() ([]byte, []int) + func (Options_Overloads_Type_Primitive) Type() protoreflect.EnumType + func (x Options_Overloads_Type_Primitive) Enum() *Options_Overloads_Type_Primitive + func (x Options_Overloads_Type_Primitive) Number() protoreflect.EnumNumber + func (x Options_Overloads_Type_Primitive) String() string + type Options_Overloads_Type_Primitive_ struct + Primitive Options_Overloads_Type_Primitive + type Rule struct + Options *Options + Programs []*Rule_Program + func (*Rule) Descriptor() ([]byte, []int) + func (*Rule) ProtoMessage() + func (x *Rule) GetOptions() *Options + func (x *Rule) GetPrograms() []*Rule_Program + func (x *Rule) ProtoReflect() protoreflect.Message + func (x *Rule) Reset() + func (x *Rule) String() string + type RuleValidater interface + Programs func() []*ValidateProgram + func BuildRuleValidater(rule *Rule, envOpt cel.EnvOption) (RuleValidater, error) + type Rule_Program struct + Expr string + Id string + func (*Rule_Program) Descriptor() ([]byte, []int) + func (*Rule_Program) ProtoMessage() + func (x *Rule_Program) GetExpr() string + func (x *Rule_Program) GetId() string + func (x *Rule_Program) ProtoReflect() protoreflect.Message + func (x *Rule_Program) Reset() + func (x *Rule_Program) String() string + type ServiceRule struct + MethodRules map[string]*MethodRule + Options *Options + Rule *Rule + func (*ServiceRule) Descriptor() ([]byte, []int) + func (*ServiceRule) ProtoMessage() + func (x *ServiceRule) GetMethodRules() map[string]*MethodRule + func (x *ServiceRule) GetOptions() *Options + func (x *ServiceRule) GetRule() *Rule + func (x *ServiceRule) ProtoReflect() protoreflect.Message + func (x *ServiceRule) Reset() + func (x *ServiceRule) String() string + type ServiceRuleValidater interface + Validate func(ctx context.Context, attr *attribute_context.AttributeContext, m proto.Message) error + type ValidateProgram struct + Expr string + Id string + Program cel.Program + type Validater interface + Validate func(ctx context.Context) error + ValidateWithMask func(ctx context.Context, fm *fieldmaskpb.FieldMask) error