descriptivetype

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DescriptionExtender

type DescriptionExtender[T any] func(t T) string

DescriptionExtender provides an additional description for a type object which is appended to the format description in the scheme description for the type in question.

type Option

func WithDescription

func WithDescription(value string) Option

func WithFormatSpec

func WithFormatSpec(value string) Option

type OptionTarget

type OptionTarget interface {
	SetFormat(string)
	SetDescription(string)
}

type TypeObjectTarget

type TypeObjectTarget[E runtime.VersionedTypedObject] struct {
	// contains filtered or unexported fields
}

TypeObjectTarget is used as target for option functions, it provides setters for fields, which should not be modifiable for a final type object.

func (*TypeObjectTarget[E]) SetDescription

func (t *TypeObjectTarget[E]) SetDescription(value string)

func (*TypeObjectTarget[E]) SetFormat

func (t *TypeObjectTarget[E]) SetFormat(value string)

type TypeScheme

type TypeScheme[T runtime.VersionedTypedObject, R TypedObjectType[T]] interface {
	runtime.TypeScheme[T, R]

	Describe() string
}

TypeScheme is the appropriately extended scheme interface based on runtime.TypeScheme. Based on the additional type info a complete scheme description can be created calling the Describe method.

func MustNewDefaultTypeScheme

func MustNewDefaultTypeScheme[T runtime.VersionedTypedObject, R TypedObjectType[T], S TypeScheme[T, R]](name string, extender DescriptionExtender[R], unknown runtime.Unstructured, acceptUnknown bool, defaultdecoder runtime.TypedObjectDecoder[T], base ...TypeScheme[T, R]) TypeScheme[T, R]

func NewTypeScheme

func NewTypeScheme[T runtime.VersionedTypedObject, R TypedObjectType[T], S TypeScheme[T, R]](name string, extender DescriptionExtender[R], unknown runtime.Unstructured, acceptUnknown bool, base ...S) TypeScheme[T, R]

NewTypeScheme provides an TypeScheme implementation based on the interfaces and the default runtime.TypeScheme implementation.

type TypedObjectType

type TypedObjectType[T runtime.VersionedTypedObject] interface {
	runtime.VersionedTypedObjectType[T]

	Description() string
	Format() string
}

TypedObjectType is the appropriately extended type interface based on runtime.VersionTypedObjectType providing support for a functional and format description.

type TypedObjectTypeObject

type TypedObjectTypeObject[T runtime.VersionedTypedObject] struct {
	runtime.VersionedTypedObjectType[T]
	// contains filtered or unexported fields
}

func (*TypedObjectTypeObject[T]) Description

func (t *TypedObjectTypeObject[T]) Description() string

func (*TypedObjectTypeObject[T]) Format

func (t *TypedObjectTypeObject[T]) Format() string

func (*TypedObjectTypeObject[T]) Validate

func (t *TypedObjectTypeObject[T]) Validate(e T) error

Jump to

Keyboard shortcuts

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