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 ¶
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 ¶
func NewTypeSchemeWrapper[T runtime.VersionedTypedObject, R VersionTypedObjectType[T], P flagsets.ConfigTypeOptionSetConfigProvider](s TypeScheme[T, R]) ExtendedTypeScheme[T, R, P]
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 ¶
type OptionTarget interface { descriptivetype.OptionTarget SetConfigHandler(flagsets.ConfigOptionTypeSetHandler) }
type TypeObjectTarget ¶
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 ¶
func NewTypeObjectTarget[E runtime.VersionedTypedObject](target *TypedObjectTypeObject[E]) *TypeObjectTarget[E]
func (TypeObjectTarget[E]) SetConfigHandler ¶
func (t TypeObjectTarget[E]) SetConfigHandler(value flagsets.ConfigOptionTypeSetHandler)
type TypeOption ¶
type TypeOption = optionutils.Option[OptionTarget]
func WithConfigHandler ¶
func WithConfigHandler(value flagsets.ConfigOptionTypeSetHandler) TypeOption
func WithDescription ¶
func WithDescription(value string) TypeOption
func WithFormatSpec ¶
func WithFormatSpec(value string) TypeOption
type TypeScheme ¶
type TypeScheme[T runtime.VersionedTypedObject, R VersionTypedObjectType[T]] interface { ExtendedTypeScheme[T, R, flagsets.ConfigTypeOptionSetConfigProvider] }
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 ¶
type TypedObjectTypeObject[E runtime.VersionedTypedObject] struct { *descriptivetype.TypedObjectTypeObject[E] // contains filtered or unexported fields }
func NewTypedObjectTypeObject ¶
func NewTypedObjectTypeObject[E runtime.VersionedTypedObject](vt runtime.VersionedTypedObjectType[E], opts ...TypeOption) *TypedObjectTypeObject[E]
func (*TypedObjectTypeObject[E]) ConfigOptionTypeSetHandler ¶
func (t *TypedObjectTypeObject[E]) ConfigOptionTypeSetHandler() flagsets.ConfigOptionTypeSetHandler
func (*TypedObjectTypeObject[E]) Validate ¶
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.