Help us shape the future of Go! Take the 2026 Go Developer Survey

validation

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validator = &RuntimeObjectsValidator{map[reflect.Type]RuntimeObjectValidatorInfo{}}

Functions

func GetRequiresNamespace

func GetRequiresNamespace(obj runtime.Object) (bool, error)

func HasObjectMeta

func HasObjectMeta(obj runtime.Object) bool

Types

type RuntimeObjectValidator

type RuntimeObjectValidator interface {
	Validate(obj runtime.Object) field.ErrorList
	ValidateUpdate(obj, old runtime.Object) field.ErrorList
}

type RuntimeObjectValidatorInfo

type RuntimeObjectValidatorInfo struct {
	Validator     RuntimeObjectValidator
	IsNamespaced  bool
	HasObjectMeta bool
	UpdateAllowed bool
}

type RuntimeObjectsValidator

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

func (*RuntimeObjectsValidator) GetInfo

func (*RuntimeObjectsValidator) MustRegister added in v1.1.3

func (v *RuntimeObjectsValidator) MustRegister(obj runtime.Object, validateFunction interface{}, validateUpdateFunction interface{})

func (*RuntimeObjectsValidator) Register

func (v *RuntimeObjectsValidator) Register(obj runtime.Object, validateFunction interface{}, validateUpdateFunction interface{}) error

func (*RuntimeObjectsValidator) Validate

func (*RuntimeObjectsValidator) ValidateUpdate

func (v *RuntimeObjectsValidator) ValidateUpdate(obj, old runtime.Object) field.ErrorList

type WrappingValidator

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

func NewValidationWrapper

func NewValidationWrapper(validateFunction interface{}, validateUpdateFunction interface{}) (*WrappingValidator, error)

func (*WrappingValidator) Validate

func (v *WrappingValidator) Validate(obj runtime.Object) field.ErrorList

func (*WrappingValidator) ValidateUpdate

func (v *WrappingValidator) ValidateUpdate(obj, old runtime.Object) field.ErrorList

Source Files

  • register.go
  • validation.go
  • wrapper.go

Jump to

Keyboard shortcuts

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