defaultbehavior

package
v0.35.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

This is a test package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterValidations

func RegisterValidations(scheme *testscheme.Scheme) error

RegisterValidations adds validation functions to the given scheme. Public to allow building arbitrary schemes.

func Validate_AliasMapKeyType

func Validate_AliasMapKeyType(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj AliasMapKeyType) (errs field.ErrorList)

Validate_AliasMapKeyType validates an instance of AliasMapKeyType according to declarative validation rules in the API schema.

func Validate_AliasMapValueType

func Validate_AliasMapValueType(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj AliasMapValueType) (errs field.ErrorList)

Validate_AliasMapValueType validates an instance of AliasMapValueType according to declarative validation rules in the API schema.

func Validate_DirectComparableStruct

func Validate_DirectComparableStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *DirectComparableStruct) (errs field.ErrorList)

Validate_DirectComparableStruct validates an instance of DirectComparableStruct according to declarative validation rules in the API schema.

func Validate_MixComparableStruct

func Validate_MixComparableStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *MixComparableStruct) (errs field.ErrorList)

Validate_MixComparableStruct validates an instance of MixComparableStruct according to declarative validation rules in the API schema.

func Validate_MySlice

func Validate_MySlice(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj MySlice) (errs field.ErrorList)

Validate_MySlice validates an instance of MySlice according to declarative validation rules in the API schema.

func Validate_NestedDirectComparableStruct

func Validate_NestedDirectComparableStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NestedDirectComparableStruct) (errs field.ErrorList)

Validate_NestedDirectComparableStruct validates an instance of NestedDirectComparableStruct according to declarative validation rules in the API schema.

func Validate_NestedNonDirectComparableStruct

func Validate_NestedNonDirectComparableStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NestedNonDirectComparableStruct) (errs field.ErrorList)

Validate_NestedNonDirectComparableStruct validates an instance of NestedNonDirectComparableStruct according to declarative validation rules in the API schema.

func Validate_NonDirectComparableStruct

func Validate_NonDirectComparableStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NonDirectComparableStruct) (errs field.ErrorList)

Validate_NonDirectComparableStruct validates an instance of NonDirectComparableStruct according to declarative validation rules in the API schema.

func Validate_S

func Validate_S(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *S) (errs field.ErrorList)

Validate_S validates an instance of S according to declarative validation rules in the API schema.

func Validate_StructEmbedded

func Validate_StructEmbedded(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *StructEmbedded) (errs field.ErrorList)

Validate_StructEmbedded validates an instance of StructEmbedded according to declarative validation rules in the API schema.

func Validate_StructMap

func Validate_StructMap(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *StructMap) (errs field.ErrorList)

Validate_StructMap validates an instance of StructMap according to declarative validation rules in the API schema.

func Validate_StructPrimitive

func Validate_StructPrimitive(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *StructPrimitive) (errs field.ErrorList)

Validate_StructPrimitive validates an instance of StructPrimitive according to declarative validation rules in the API schema.

func Validate_StructSlice

func Validate_StructSlice(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *StructSlice) (errs field.ErrorList)

Validate_StructSlice validates an instance of StructSlice according to declarative validation rules in the API schema.

func Validate_StructStruct

func Validate_StructStruct(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *StructStruct) (errs field.ErrorList)

Validate_StructStruct validates an instance of StructStruct according to declarative validation rules in the API schema.

Types

type AliasMapKeyType

type AliasMapKeyType MapKeyType

+k8s:validateFalse="type MapKeyType"

type AliasMapValueType

type AliasMapValueType MapValueType

+k8s:validateFalse="type MapValueType"

type DirectComparableStruct

type DirectComparableStruct struct {
	// +k8s:validateFalse="field intField"
	IntField int `json:"intField"`
}

+k8s:validateFalse="type DirectComparableStruct"

type MapKeyType

type MapKeyType map[S]string

no validation

type MapValueType

type MapValueType map[string]S

no validation

type MixComparableStruct

type MixComparableStruct struct {
	TypeMeta int

	Primitive string `json:"Primitive"`

	// +k8s:validateFalse="field NonComparable"
	NonComparable []string `json:"NonComparable"`
}

type MySlice

type MySlice []int

+k8s:validateFalse="type MySlice"

type NestedDirectComparableStruct

type NestedDirectComparableStruct struct {
	// +k8s:validateFalse="field directComparableStructField"
	DirectComparableStructField DirectComparableStruct `json:"directComparableStructField"`
}

+k8s:validateFalse="type NestedDirectComparableStruct"

type NestedNonDirectComparableStruct

type NestedNonDirectComparableStruct struct {
	// +k8s:validateFalse="field nonDirectComparableStructField"
	NonDirectComparableStructField NonDirectComparableStruct `json:"nonDirectComparableStructField"`
}

+k8s:validateFalse="type NestedNonDirectComparableStruct"

type NonDirectComparableStruct

type NonDirectComparableStruct struct {
	// +k8s:validateFalse="field intPtrField"
	IntPtrField *int `json:"intPtrField"`
}

+k8s:validateFalse="type NonDirectComparableStruct"

type S

type S string

+k8s:validateFalse="type S"

type StructEmbedded

type StructEmbedded struct {
	TypeMeta int
	// +k8s:validateFalse="field DirectComparableStruct"
	DirectComparableStruct `json:"directComparableStruct"`

	// +k8s:validateFalse="field NonDirectComparableStruct"
	NonDirectComparableStruct `json:"nonDirectComparableStruct"`

	// +k8s:validateFalse="field NestedDirectComparableStructField"
	NestedDirectComparableStructField NestedDirectComparableStruct `json:"nestedDirectComparableStructField"`

	// +k8s:validateFalse="field NestedNonDirectComparableStructField"
	NestedNonDirectComparableStructField NestedNonDirectComparableStruct `json:"nestedNonDirectComparableStructField"`
}

type StructMap

type StructMap struct {
	TypeMeta int

	// +k8s:validateFalse="field mapKeyField"
	MapKeyField map[S]string `json:"mapKeyField"`

	// +k8s:validateFalse="field mapValueField"
	MapValueField map[string]S `json:"mapValueField"`

	// +k8s:validateFalse="field aliasMapKeyTypeField"
	AliasMapKeyTypeField AliasMapKeyType `json:"aliasMapKeyTypeField"`

	// +k8s:validateFalse="field aliasMapValueTypeField"
	AliasMapValueTypeField AliasMapValueType `json:"aliasMapValueTypeField"`
}

type StructPrimitive

type StructPrimitive struct {
	TypeMeta int

	// +k8s:validateFalse="field intField"
	IntField int `json:"intField"`

	// +k8s:optional
	// +k8s:validateFalse="field intPtrField"
	IntPtrField *int `json:"intPtrField"`
}

type StructSlice

type StructSlice struct {
	TypeMeta int

	// +k8s:validateFalse="field sliceField"
	SliceField []S `json:"sliceField"`

	// +k8s:validateFalse="field typedefSliceField"
	TypeDefSliceField MySlice `json:"typedefSliceField"`
}

type StructStruct

type StructStruct struct {
	TypeMeta int

	// +k8s:validateFalse="field directComparableStructField"
	DirectComparableStructField DirectComparableStruct `json:"directComparableStructField"`

	// +k8s:validateFalse="field nonDirectComparableStructField"
	NonDirectComparableStructField NonDirectComparableStruct `json:"nonDirectComparableStructField"`

	// +k8s:validateFalse="field directComparableStructPtrField"
	DirectComparableStructPtr *DirectComparableStruct `json:"directComparableStructPtrField"`

	// +k8s:validateFalse="field nonDirectComparableStructPtrField"
	NonDirectComparableStructPtr *NonDirectComparableStruct `json:"nonDirectComparableStructPtrField"`

	// +k8s:validateFalse="field DirectComparableStruct"
	DirectComparableStruct

	// +k8s:validateFalse="field NonDirectComparableStruct"
	NonDirectComparableStruct
}

type TypeDefStruct

type TypeDefStruct struct{}

+k8s:validateFalse="type TypeDefStruct"

Jump to

Keyboard shortcuts

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