evaluator

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Load func(desc protoreflect.MessageDescriptor) MessageEvaluator
	// contains filtered or unexported fields
}

Builder is a build-through cache of message evaluators keyed off the provided descriptor.

func NewBuilder

func NewBuilder(
	env *cel.Env,
	disableLazy bool,
	res StandardConstraintResolver,
	seedDesc ...protoreflect.MessageDescriptor,
) *Builder

NewBuilder initializes a new Builder.

type MessageCache added in v0.3.2

type MessageCache map[protoreflect.MessageDescriptor]*message

func (MessageCache) Clone added in v0.3.2

func (c MessageCache) Clone() MessageCache

func (MessageCache) SyncTo added in v0.3.2

func (c MessageCache) SyncTo(other MessageCache)

type MessageEvaluator

type MessageEvaluator interface {

	// EvaluateMessage checks that the provided msg is valid. See
	// evaluator.Evaluate for behavior
	EvaluateMessage(msg protoreflect.Message, failFast bool) error
	// contains filtered or unexported methods
}

MessageEvaluator is essentially the same as evaluator, but specialized for messages as an optimization. See evaluator for behavior.

type StandardConstraintResolver

type StandardConstraintResolver interface {
	ResolveMessageConstraints(desc protoreflect.MessageDescriptor) *validate.MessageConstraints
	ResolveOneofConstraints(desc protoreflect.OneofDescriptor) *validate.OneofConstraints
	ResolveFieldConstraints(desc protoreflect.FieldDescriptor) *validate.FieldConstraints
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL