configmeta

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package configmeta provides a central registry of all environment-variable based configuration items used by the DWS CLI. Each package registers its own items via init(), and the "dws config list" command reads the registry to present a unified view to the developer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(item ConfigItem)

Register adds a configuration item to the global registry. Duplicate names are silently ignored (first registration wins).

func Reset

func Reset()

Reset clears the registry. Intended for testing only.

func Resolve

func Resolve(name string) (string, bool)

Resolve returns the current value of the named environment variable. For sensitive items the value is masked. Returns ("", false) when the variable is not set.

Types

type Category

type Category string

Category groups related configuration items for display purposes.

const (
	CategoryCore     Category = "core"
	CategoryAuth     Category = "auth"
	CategoryNetwork  Category = "network"
	CategorySecurity Category = "security"
	CategoryRuntime  Category = "runtime"
	CategoryDebug    Category = "debug"
	CategoryExternal Category = "external"
)

func Categories

func Categories() []Category

Categories returns all known category values in display order.

type ConfigItem

type ConfigItem struct {
	Name         string   // Environment variable name, e.g. "DWS_CONFIG_DIR"
	Category     Category // Logical grouping
	Description  string   // Short human-readable description
	DefaultValue string   // Description of the default value
	Example      string   // Example value for documentation
	Sensitive    bool     // If true, actual value is masked in output
	Hidden       bool     // If true, omitted from default list output
}

ConfigItem describes a single environment-variable configuration item.

func All

func All() []ConfigItem

All returns every registered configuration item sorted by category (display order) then by name.

func ByCategory

func ByCategory(cat Category) []ConfigItem

ByCategory returns registered items that match the given category.

Jump to

Keyboard shortcuts

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