validation

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Deprecated use k8s.io/apimachinery/pkg/util/validation/field directly

Index

Constants

View Source
const CurrentField = ""

Deprecated CurrentField is an empty string representing an empty path to the current field.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldErrors

type FieldErrors field.ErrorList

Deprecated FieldErrors extends an ErrorList to compose helper methods to compose field paths.

func ErrDisallowedFields

func ErrDisallowedFields(name string, detail string) FieldErrors

Deprecated ErrDisallowedFields wraps a forbidden error as field errors

func ErrDuplicateValue

func ErrDuplicateValue(value interface{}, names ...string) FieldErrors

Deprecated ErrDuplicateValue wraps an duplicate error as field errors

func ErrInvalidArrayValue

func ErrInvalidArrayValue(value interface{}, name string, index int) FieldErrors

Deprecated ErrInvalidArrayValue wraps an invalid error for an array item as field errors

func ErrInvalidValue

func ErrInvalidValue(value interface{}, name string) FieldErrors

Deprecated ErrInvalidValue wraps an invalid error as field errors

func ErrMissingField

func ErrMissingField(name string) FieldErrors

Deprecated ErrMissingField wraps an required error as field errors

func ErrMissingOneOf

func ErrMissingOneOf(names ...string) FieldErrors

Deprecated ErrMissingOneOf wraps an required error for the specified fields as field errors

func ErrMultipleOneOf

func ErrMultipleOneOf(names ...string) FieldErrors

Deprecated ErrMultipleOneOf wraps an required error for the specified fields as field errors

func (FieldErrors) Also

func (e FieldErrors) Also(errs ...FieldErrors) FieldErrors

Deprecated Also appends additional field errors to the current set of errors.

func (FieldErrors) ErrorList

func (e FieldErrors) ErrorList() field.ErrorList

Deprecated ErrorList converts a FieldErrors to an api machinery field ErrorList

func (FieldErrors) ToAggregate

func (e FieldErrors) ToAggregate() error

Deprecated ToAggregate combines the field errors into a single go error, or nil if there are no errors.

func (FieldErrors) ViaField

func (e FieldErrors) ViaField(key string) FieldErrors

Deprecated ViaField prepends the path of each error with the field's key using a dot notation separator (e.g. '.foo')

func (FieldErrors) ViaFieldIndex

func (e FieldErrors) ViaFieldIndex(key string, index int) FieldErrors

Deprecated ViaFieldIndex prepends the path of each error with the fields key and index (e.g. '.foo[0]').

func (FieldErrors) ViaIndex

func (e FieldErrors) ViaIndex(index int) FieldErrors

Deprecated ViaIndex prepends the path of each error with the field's index using square bracket separators (e.g. '[0]').

type FieldValidator

type FieldValidator interface {
	Validate() FieldErrors
}

type Validatable

type Validatable = interface {
	Validate(context.Context) FieldErrors
}

Deprecated

Jump to

Keyboard shortcuts

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