constraints

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectedWrapperConstraints

func ExpectedWrapperConstraints(fqn protoreflect.FullName) (desc protoreflect.FieldDescriptor, ok bool)

ExpectedWrapperConstraints returns the validate.FieldConstraints field that is expected for the given wrapper well-known type's full name. If ok is false, no standard constraints exist for that type.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache is a build-through cache to computed standard constraints.

func NewCache

func NewCache() Cache

NewCache constructs a new build-through cache for the standard constraints.

func (*Cache) Build

func (c *Cache) Build(
	env *cel.Env,
	fieldDesc protoreflect.FieldDescriptor,
	fieldConstraints *validate.FieldConstraints,
	forItems bool,
) (set expression.ProgramSet, err error)

Build creates the standard constraints for the given field. If forItems is true, the constraints for repeated list items is built instead of the constraints on the list itself.

Jump to

Keyboard shortcuts

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