pointers

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 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_T1

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

func Validate_T2

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

Types

type T1

type T1 struct {
	TypeMeta int

	// +k8s:validateFalse="field T1.PS"
	PS *string `json:"ps"`
	// +k8s:validateFalse="field T1.PI"
	PI *int `json:"pi"`
	// +k8s:validateFalse="field T1.PB"
	PB *bool `json:"pb"`
	// +k8s:validateFalse="field T1.PF"
	PF *float64 `json:"pf"`

	// +k8s:validateFalse="field T1.PT2"
	PT2 *T2 `json:"pt2"`

	// Duplicate types with no validation.
	AnotherPS *string  `json:"anotherps"`
	AnotherPI *int     `json:"anotherpi"`
	AnotherPB *bool    `json:"anotherpb"`
	AnotherPF *float64 `json:"anotherpf"`
}

type T2

type T2 struct {
	// +k8s:validateFalse="field T2.PS"
	PS *string `json:"ps"`
	// +k8s:validateFalse="field T2.PI"
	PI *int `json:"pi"`
	// +k8s:validateFalse="field T2.PB"
	PB *bool `json:"pb"`
	// +k8s:validateFalse="field T2.PF"
	PF *float64 `json:"pf"`
}

Note: This has validations and is linked into the type-graph of T1.

Jump to

Keyboard shortcuts

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