eachkey

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 7 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_Struct

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

func Validate_ValidatedMapType

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

func Validate_ValidatedStringType

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

Types

type Struct

type Struct struct {
	TypeMeta int

	// +k8s:validateFalse="field Struct.MapField"
	// +k8s:eachKey=+k8s:validateFalse="field Struct.MapField(keys)"
	MapField map[string]string `json:"mapField"`

	// +k8s:validateFalse="field Struct.MapTypedefField"
	// +k8s:eachKey=+k8s:validateFalse="field Struct.MapTypedefField(keys)"
	MapTypedefField map[UnvalidatedStringType]string `json:"mapTypedefField"`

	// +k8s:validateFalse="field Struct.MapValidatedTypedefField"
	// +k8s:eachKey=+k8s:validateFalse="field Struct.MapValidatedTypedefField(keys)"
	MapValidatedTypedefField map[ValidatedStringType]string `json:"mapValidatedTypedefField"`

	// +k8s:validateFalse="field Struct.MapTypeField"
	// +k8s:eachKey=+k8s:validateFalse="field Struct.MapTypeField(keys)"
	MapTypeField UnvalidatedMapType `json:"mapTypeField"`

	// +k8s:validateFalse="field Struct.ValidatedMapTypeField"
	// +k8s:eachKey=+k8s:validateFalse="field Struct.ValidatedMapTypeField(keys)"
	ValidatedMapTypeField ValidatedMapType `json:"validatedMapTypeField"`
}

+k8s:validateFalse="type Struct"

type UnvalidatedMapType

type UnvalidatedMapType map[string]string

Note: no validations.

type UnvalidatedStringType

type UnvalidatedStringType string

Note: no validations.

type ValidatedMapType

type ValidatedMapType map[string]string

+k8s:validateFalse="ValidatedMapType" +k8s:eachKey=+k8s:validateFalse="type ValidatedMapType(keys)"

type ValidatedStringType

type ValidatedStringType string

+k8s:validateFalse="ValidatedStringType"

Jump to

Keyboard shortcuts

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