config

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Align = 0 // Cleartext alignment, if not set it is autodetected

Functions

func Help

func Help(w io.Writer, c CfgMap)

func Parse

func Parse(c CfgMap) error

func PrintableConfig

func PrintableConfig(c CfgMap) []string

Types

type CfgMap

type CfgMap map[string]Config

type Config

type Config struct {
	Value        any       // Value
	DefaultValue any       // Default value if Value is not set
	Help         string    // One line help
	Print        PrintMode // Print mode
	Required     bool      // If true, error out with error
	Parse        func(envValue string) (any, error)
}

type PrintMode

type PrintMode int
const (
	PrintSecret PrintMode = iota
	PrintAll
	PrintNothing
)

Jump to

Keyboard shortcuts

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