flagsetscheme

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package flagsetscheme provides a runtime.TypeScheme with support for command line option sets for the described object types. Therefore, the object types (VersionTypedObjectType) have to provide a flagsets.ConfigOptionTypeSetHandler. To support CLI help information, they should additionally provide a description and structure information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedTypeScheme added in v0.9.0

type ExtendedTypeScheme[T runtime.VersionedTypedObject, R VersionTypedObjectType[T], P flagsets.ConfigTypeOptionSetConfigProvider] interface {
	descriptivetype.TypeScheme[T, R]

	CreateConfigTypeSetConfigProvider() P

	Unwrap() TypeScheme[T, R]
}

ExtendedTypeScheme is the appropriately extended scheme interface based on runtime.TypeScheme supporting an extended config provider interface.

func NewTypeSchemeWrapper added in v0.9.0

NewTypeSchemeWrapper wraps a TypeScheme into a scheme returning a specialized config provider by casting the result. The type scheme constructor provides different implementations based on its arguments. This method here can be used to provide a type scheme returning the correct type.

type OptionTarget added in v0.5.0

type OptionTarget interface {
	descriptivetype.OptionTarget
	SetConfigHandler(flagsets.ConfigOptionTypeSetHandler)
}

type TypeObjectTarget added in v0.5.0

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

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

func NewTypeObjectTarget added in v0.5.0

func NewTypeObjectTarget[E runtime.VersionedTypedObject](target *TypedObjectTypeObject[E]) *TypeObjectTarget[E]

func (TypeObjectTarget[E]) SetConfigHandler added in v0.5.0

func (t TypeObjectTarget[E]) SetConfigHandler(value flagsets.ConfigOptionTypeSetHandler)

type TypeOption added in v0.5.0

type TypeOption = optionutils.Option[OptionTarget]

func WithConfigHandler added in v0.5.0

func WithConfigHandler(value flagsets.ConfigOptionTypeSetHandler) TypeOption

func WithDescription added in v0.5.0

func WithDescription(value string) TypeOption

func WithFormatSpec added in v0.5.0

func WithFormatSpec(value string) TypeOption

type TypeScheme

TypeScheme is the appropriately extended scheme interface based on runtime.TypeScheme.

func NewTypeScheme

func NewTypeScheme[T runtime.VersionedTypedObject, R VersionTypedObjectType[T], S TypeScheme[T, R]](kindname string, cfgname, typeOption, desc, group string, 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 TypedObjectTypeObject added in v0.5.0

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

func NewTypedObjectTypeObject added in v0.5.0

func NewTypedObjectTypeObject[E runtime.VersionedTypedObject](vt runtime.VersionedTypedObjectType[E], opts ...TypeOption) *TypedObjectTypeObject[E]

func (*TypedObjectTypeObject[E]) ConfigOptionTypeSetHandler added in v0.5.0

func (t *TypedObjectTypeObject[E]) ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler

func (*TypedObjectTypeObject[E]) Validate added in v0.5.0

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

type VersionTypedObjectType

type VersionTypedObjectType[T runtime.VersionedTypedObject] interface {
	descriptivetype.TypedObjectType[T]

	ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler
}

VersionTypedObjectType is the appropriately extended type interface based on runtime.VersionTypedObjectType.

Jump to

Keyboard shortcuts

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