config

package
v0.0.0-...-4e3d77a Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_CONFIG string

Functions

func Get

func Get(key string) any

func GetBool

func GetBool(key string) bool

func GetBoolDefault

func GetBoolDefault(key string, defaultValue bool) bool

func GetDefault

func GetDefault(key string, defaultValue any) any

func GetFloat

func GetFloat(key string) float64

func GetFloatDefault

func GetFloatDefault(key string, defaultValue float64) float64

func GetInt

func GetInt(key string) int

func GetIntDefault

func GetIntDefault(key string, defaultValue int) int

func GetString

func GetString(key string) string

func GetStringDefault

func GetStringDefault(key string, defaultValue string) string

func HandleConfigArgs

func HandleConfigArgs(args ConfigArgs) error

func Has

func Has(key string) bool

func InitLogging

func InitLogging()

func LoadFile

func LoadFile(path string) error

See LoadReader().

func LoadReader

func LoadReader(reader io.Reader) error

Load data into the configuration. This will not clear out an existing configuration (so can load multiple files). If there are any key conflicts, the data loaded last will win. If you want to clear the config, use Reset().

func LoadString

func LoadString(text string) error

See LoadReader().

func Reset

func Reset()

func Set

func Set(key string, value any)

Types

type ConfigArgs

type ConfigArgs struct {
	ConfigPath []string          `help:"Path to config file to load." type:"existingfile"`
	Config     map[string]string `help:"Config options."`
}

A Kong-style struct for adding on all the config-related options to a CLI.

Jump to

Keyboard shortcuts

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