container

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package container defines the source and classification metadata used by CONGA's built-in command-line containers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification

type Classification struct {
	Kind     Kind
	Required bool
	Target   any
}

Classification is the engine's classification of one command-struct field. Kind and Required are plain metadata. Target carries the inner command struct pointer for the command kinds so the schema builder can reflect over it; the field's container itself travels separately as an opaque handle.

type Kind

type Kind uint8

Kind identifies the engine container role a command-struct field plays. The engine classifies each field once during schema build; the schema builder treats the classification as plain data and never inspects container behavior itself.

const (
	// KindNone marks a field that is not a built-in container.
	KindNone Kind = iota

	// KindFlag marks an optional or required flag container.
	KindFlag

	// KindCounter marks a counter flag container.
	KindCounter

	// KindConfigFile marks the merged configuration-file flag container.
	KindConfigFile

	// KindArg marks an optional or required positional argument container.
	KindArg

	// KindCommand marks a subcommand container.
	KindCommand

	// KindDashArgs marks the '--' trailing-arguments container.
	KindDashArgs

	// KindRawArgs marks the raw trailing-tokens container.
	KindRawArgs

	// KindHelpCommand marks the opt-in help subcommand container.
	KindHelpCommand

	// KindVersionCommand marks the opt-in version subcommand container.
	KindVersionCommand

	// KindCompletionCommand marks the opt-in completion subcommand container.
	KindCompletionCommand

	// KindFeatures marks the root feature-declaration container.
	KindFeatures
)

type Source

type Source int

Source identifies the origin of a resolved flag or argument value.

const (
	// SourceNone indicates the value was not provided from any source.
	SourceNone Source = iota

	// SourceDefault indicates the value came from the struct tag's `default` definition.
	SourceDefault

	// SourceConfig indicates the value was resolved from a configuration file.
	SourceConfig

	// SourceEnv indicates the value was resolved from an environment variable.
	SourceEnv

	// SourceCLI indicates the value was explicitly passed on the command line.
	SourceCLI
)

func (Source) String

func (s Source) String() string

String returns a human-readable name for the value source.

Jump to

Keyboard shortcuts

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