validation

package
v0.12.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingRequiredField = Error("missing required field")
	ErrInvalidValue         = Error("invalid value")
	ErrDuplicate            = Error("duplicate value in list")
	ErrReadOnlyField        = Error("field is read-only")
	ErrInvalidLabelName     = Errorf("label names %s, and %s", nameConstraint, lengthConstraint(64))
	ErrInvalidLabelValue    = Errorf("label values %s, and %s", nameConstraint, lengthConstraint(64))
	ErrInvalidName          = Errorf("names %s, and %s", nameConstraint, lengthConstraint(64))
	ErrInvalidRoleName      = Errorf("role names %s, and %s", nameConstraint, lengthConstraint(64))
	ErrInvalidSubjectName   = Errorf("subject names %s and %s", lengthConstraint(256), annoyingCharactersConstraint)
	ErrInvalidID            = Errorf("ids %s, and %s", nameConstraint, lengthConstraint(128))
)

Functions

func Error

func Error(msg string) error

func Errorf

func Errorf(format string, args ...interface{}) error

func Validate

func Validate(v Validator) error

func ValidateID

func ValidateID(id string) error

func ValidateLabelName

func ValidateLabelName(name string) error

func ValidateLabelValue

func ValidateLabelValue(value string) error

func ValidateLabels

func ValidateLabels(labels map[string]string) error

func ValidateSubject

func ValidateSubject(subject string) error

Types

type ValidationError

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

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) GRPCStatus

func (e *ValidationError) GRPCStatus() *status.Status

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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