Documentation
¶
Index ¶
- Variables
- type Schema
- func (*Schema) Descriptor() ([]byte, []int)deprecated
- func (x *Schema) GetDefinition() []byte
- func (x *Schema) GetId() string
- func (m *Schema) HashPB(hasher hash.Hash, ignore map[string]struct{})
- func (m *Schema) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Schema) MarshalToVT(dAtA []byte) (int, error)
- func (m *Schema) MarshalVT() (dAtA []byte, err error)
- func (*Schema) ProtoMessage()
- func (x *Schema) ProtoReflect() protoreflect.Message
- func (x *Schema) Reset()
- func (m *Schema) SizeVT() (n int)
- func (x *Schema) String() string
- func (m *Schema) UnmarshalVT(dAtA []byte) error
- func (m *Schema) Validate() error
- func (m *Schema) ValidateAll() error
- type SchemaMultiError
- type SchemaValidationError
- type ValidationError
- func (*ValidationError) Descriptor() ([]byte, []int)deprecated
- func (x *ValidationError) GetMessage() string
- func (x *ValidationError) GetPath() string
- func (x *ValidationError) GetSource() ValidationError_Source
- func (m *ValidationError) HashPB(hasher hash.Hash, ignore map[string]struct{})
- func (m *ValidationError) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ValidationError) MarshalToVT(dAtA []byte) (int, error)
- func (m *ValidationError) MarshalVT() (dAtA []byte, err error)
- func (*ValidationError) ProtoMessage()
- func (x *ValidationError) ProtoReflect() protoreflect.Message
- func (x *ValidationError) Reset()
- func (m *ValidationError) SizeVT() (n int)
- func (x *ValidationError) String() string
- func (m *ValidationError) UnmarshalVT(dAtA []byte) error
- func (m *ValidationError) Validate() error
- func (m *ValidationError) ValidateAll() error
- type ValidationErrorMultiError
- type ValidationErrorValidationError
- func (e ValidationErrorValidationError) Cause() error
- func (e ValidationErrorValidationError) Error() string
- func (e ValidationErrorValidationError) ErrorName() string
- func (e ValidationErrorValidationError) Field() string
- func (e ValidationErrorValidationError) Key() bool
- func (e ValidationErrorValidationError) Reason() string
- type ValidationError_Source
- func (ValidationError_Source) Descriptor() protoreflect.EnumDescriptor
- func (x ValidationError_Source) Enum() *ValidationError_Source
- func (ValidationError_Source) EnumDescriptor() ([]byte, []int)deprecated
- func (x ValidationError_Source) Number() protoreflect.EnumNumber
- func (x ValidationError_Source) String() string
- func (ValidationError_Source) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( ValidationError_Source_name = map[int32]string{ 0: "SOURCE_UNSPECIFIED", 1: "SOURCE_PRINCIPAL", 2: "SOURCE_RESOURCE", } ValidationError_Source_value = map[string]int32{ "SOURCE_UNSPECIFIED": 0, "SOURCE_PRINCIPAL": 1, "SOURCE_RESOURCE": 2, } )
Enum value maps for ValidationError_Source.
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_cerbos_schema_v1_schema_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Definition []byte `protobuf:"bytes,2,opt,name=definition,proto3" json:"definition,omitempty"` // contains filtered or unexported fields }
func (*Schema) Descriptor
deprecated
func (*Schema) GetDefinition ¶
func (*Schema) HashPB ¶ added in v0.13.0
HashPB computes a hash of the message using the given hash function The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash
func (*Schema) MarshalToSizedBufferVT ¶
func (*Schema) ProtoMessage ¶
func (*Schema) ProtoMessage()
func (*Schema) ProtoReflect ¶
func (x *Schema) ProtoReflect() protoreflect.Message
func (*Schema) UnmarshalVT ¶
func (*Schema) Validate ¶
Validate checks the field values on Schema with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Schema) ValidateAll ¶ added in v0.12.0
ValidateAll checks the field values on Schema with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SchemaMultiError, or nil if none found.
type SchemaMultiError ¶ added in v0.12.0
type SchemaMultiError []error
SchemaMultiError is an error wrapping multiple validation errors returned by Schema.ValidateAll() if the designated constraints aren't met.
func (SchemaMultiError) AllErrors ¶ added in v0.12.0
func (m SchemaMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SchemaMultiError) Error ¶ added in v0.12.0
func (m SchemaMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SchemaValidationError ¶
type SchemaValidationError struct {
// contains filtered or unexported fields
}
SchemaValidationError is the validation error returned by Schema.Validate if the designated constraints aren't met.
func (SchemaValidationError) Cause ¶
func (e SchemaValidationError) Cause() error
Cause function returns cause value.
func (SchemaValidationError) Error ¶
func (e SchemaValidationError) Error() string
Error satisfies the builtin error interface
func (SchemaValidationError) ErrorName ¶
func (e SchemaValidationError) ErrorName() string
ErrorName returns error name.
func (SchemaValidationError) Field ¶
func (e SchemaValidationError) Field() string
Field function returns field value.
func (SchemaValidationError) Key ¶
func (e SchemaValidationError) Key() bool
Key function returns key value.
func (SchemaValidationError) Reason ¶
func (e SchemaValidationError) Reason() string
Reason function returns reason value.
type ValidationError ¶
type ValidationError struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Source ValidationError_Source `protobuf:"varint,3,opt,name=source,proto3,enum=cerbos.schema.v1.ValidationError_Source" json:"source,omitempty"` // contains filtered or unexported fields }
func (*ValidationError) Descriptor
deprecated
func (*ValidationError) Descriptor() ([]byte, []int)
Deprecated: Use ValidationError.ProtoReflect.Descriptor instead.
func (*ValidationError) GetMessage ¶
func (x *ValidationError) GetMessage() string
func (*ValidationError) GetPath ¶
func (x *ValidationError) GetPath() string
func (*ValidationError) GetSource ¶
func (x *ValidationError) GetSource() ValidationError_Source
func (*ValidationError) HashPB ¶ added in v0.13.0
func (m *ValidationError) HashPB(hasher hash.Hash, ignore map[string]struct{})
HashPB computes a hash of the message using the given hash function The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash
func (*ValidationError) MarshalToSizedBufferVT ¶
func (m *ValidationError) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ValidationError) MarshalToVT ¶
func (m *ValidationError) MarshalToVT(dAtA []byte) (int, error)
func (*ValidationError) MarshalVT ¶
func (m *ValidationError) MarshalVT() (dAtA []byte, err error)
func (*ValidationError) ProtoMessage ¶
func (*ValidationError) ProtoMessage()
func (*ValidationError) ProtoReflect ¶
func (x *ValidationError) ProtoReflect() protoreflect.Message
func (*ValidationError) Reset ¶
func (x *ValidationError) Reset()
func (*ValidationError) SizeVT ¶
func (m *ValidationError) SizeVT() (n int)
func (*ValidationError) String ¶
func (x *ValidationError) String() string
func (*ValidationError) UnmarshalVT ¶
func (m *ValidationError) UnmarshalVT(dAtA []byte) error
func (*ValidationError) Validate ¶
func (m *ValidationError) Validate() error
Validate checks the field values on ValidationError with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ValidationError) ValidateAll ¶ added in v0.12.0
func (m *ValidationError) ValidateAll() error
ValidateAll checks the field values on ValidationError with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ValidationErrorMultiError, or nil if none found.
type ValidationErrorMultiError ¶ added in v0.12.0
type ValidationErrorMultiError []error
ValidationErrorMultiError is an error wrapping multiple validation errors returned by ValidationError.ValidateAll() if the designated constraints aren't met.
func (ValidationErrorMultiError) AllErrors ¶ added in v0.12.0
func (m ValidationErrorMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ValidationErrorMultiError) Error ¶ added in v0.12.0
func (m ValidationErrorMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ValidationErrorValidationError ¶
type ValidationErrorValidationError struct {
// contains filtered or unexported fields
}
ValidationErrorValidationError is the validation error returned by ValidationError.Validate if the designated constraints aren't met.
func (ValidationErrorValidationError) Cause ¶
func (e ValidationErrorValidationError) Cause() error
Cause function returns cause value.
func (ValidationErrorValidationError) Error ¶
func (e ValidationErrorValidationError) Error() string
Error satisfies the builtin error interface
func (ValidationErrorValidationError) ErrorName ¶
func (e ValidationErrorValidationError) ErrorName() string
ErrorName returns error name.
func (ValidationErrorValidationError) Field ¶
func (e ValidationErrorValidationError) Field() string
Field function returns field value.
func (ValidationErrorValidationError) Key ¶
func (e ValidationErrorValidationError) Key() bool
Key function returns key value.
func (ValidationErrorValidationError) Reason ¶
func (e ValidationErrorValidationError) Reason() string
Reason function returns reason value.
type ValidationError_Source ¶
type ValidationError_Source int32
const ( ValidationError_SOURCE_UNSPECIFIED ValidationError_Source = 0 ValidationError_SOURCE_PRINCIPAL ValidationError_Source = 1 ValidationError_SOURCE_RESOURCE ValidationError_Source = 2 )
func (ValidationError_Source) Descriptor ¶
func (ValidationError_Source) Descriptor() protoreflect.EnumDescriptor
func (ValidationError_Source) Enum ¶
func (x ValidationError_Source) Enum() *ValidationError_Source
func (ValidationError_Source) EnumDescriptor
deprecated
func (ValidationError_Source) EnumDescriptor() ([]byte, []int)
Deprecated: Use ValidationError_Source.Descriptor instead.
func (ValidationError_Source) Number ¶
func (x ValidationError_Source) Number() protoreflect.EnumNumber
func (ValidationError_Source) String ¶
func (x ValidationError_Source) String() string
func (ValidationError_Source) Type ¶
func (ValidationError_Source) Type() protoreflect.EnumType