maturity

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateArgument

func AnnotateArgument(command *cobra.Command, argumentName string, metadata Metadata) error

AnnotateArgument attaches maturity metadata to a named positional argument.

func AnnotateArgumentValue

func AnnotateArgumentValue(command *cobra.Command, argumentName, value string, metadata Metadata) error

AnnotateArgumentValue attaches maturity metadata to an accepted argument value.

func AnnotateCommand

func AnnotateCommand(command *cobra.Command, metadata Metadata) error

AnnotateCommand attaches maturity metadata to a command.

func AnnotateFlag

func AnnotateFlag(command *cobra.Command, flagName string, metadata Metadata) error

AnnotateFlag attaches maturity metadata to a flag declared by command.

func AnnotateFlagValue

func AnnotateFlagValue(command *cobra.Command, flagName, value string, metadata Metadata) error

AnnotateFlagValue attaches maturity metadata to an accepted flag value.

func DeclaredArgumentValues

func DeclaredArgumentValues(command *cobra.Command) (map[string]map[string]Metadata, error)

DeclaredArgumentValues returns accepted argument-value maturity declared on command.

func DeclaredArguments

func DeclaredArguments(command *cobra.Command) (map[string]Metadata, error)

DeclaredArguments returns positional argument maturity declared on command.

func DeclaredFlagValues

func DeclaredFlagValues(flag *pflag.Flag) (map[string]Metadata, error)

DeclaredFlagValues returns accepted value maturity declared on flag.

func Validate

func Validate(metadata Metadata) error

Validate verifies that metadata uses a supported maturity level.

Types

type Kind

type Kind string

Kind identifies the kind of capability that supplied effective maturity.

const (
	KindDefault       Kind = "default"
	KindCommand       Kind = "command"
	KindFlag          Kind = "flag"
	KindArgument      Kind = "argument"
	KindFlagValue     Kind = "flag-value"
	KindArgumentValue Kind = "argument-value"
	KindResource      Kind = "resource"
	KindOperation     Kind = "resource-operation"
)

type Level

type Level string

Level identifies the release maturity of a capability.

const (
	LevelGA          Level = "ga"
	LevelBeta        Level = "beta"
	LevelTechPreview Level = "tech-preview"
)

func (Level) DisplayName

func (level Level) DisplayName() string

DisplayName returns the user-facing name for a maturity level.

func (Level) LessThan

func (level Level) LessThan(other Level) bool

LessThan reports whether level is less mature than other.

type Metadata

type Metadata struct {
	Level        Level  `json:"level"                   yaml:"level"`
	Message      string `json:"message,omitempty"       yaml:"message,omitempty"`
	ReferenceURL string `json:"reference_url,omitempty" yaml:"reference_url,omitempty"`
}

Metadata describes the maturity of a capability.

type Resolution

type Resolution struct {
	Declared  *Metadata `json:"declared,omitempty"`
	Effective Metadata  `json:"effective"`
	Source    Source    `json:"source"`
}

Resolution contains both the local declaration and resolved maturity.

func ResolveArgument

func ResolveArgument(command *cobra.Command, argumentName string) (Resolution, error)

ResolveArgument resolves a named positional argument against command maturity.

func ResolveArgumentValue

func ResolveArgumentValue(command *cobra.Command, argumentName, value string) (Resolution, error)

ResolveArgumentValue resolves an accepted argument value against its argument maturity.

func ResolveCommand

func ResolveCommand(command *cobra.Command) (Resolution, error)

ResolveCommand resolves command maturity through its ancestor hierarchy.

func ResolveFlag

func ResolveFlag(command *cobra.Command, flagName string) (Resolution, error)

ResolveFlag resolves a visible flag against the command's effective maturity.

func ResolveFlagValue

func ResolveFlagValue(command *cobra.Command, flagName, value string) (Resolution, error)

ResolveFlagValue resolves an accepted flag value against its flag maturity.

type Source

type Source struct {
	Kind  Kind   `json:"kind"`
	Path  string `json:"path,omitempty"`
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

Source identifies the declaration that supplied effective maturity.

Directories

Path Synopsis
Package inventory collects maturity metadata from command and resource registries.
Package inventory collects maturity metadata from command and resource registries.

Jump to

Keyboard shortcuts

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