conf

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read()

func Set

func Set[T Configurable](take *T, envKey, flagKey string, def T)

func SetEnv

func SetEnv[T Configurable](take *T, envKey string, def T)

func SetEnvValidate added in v1.2.0

func SetEnvValidate[T Configurable](take *T, envKey string, def T, validator func(*T) error)

func SetFlag

func SetFlag[T Configurable](take *T, flagKey string, def T)

func SetFlagValidate added in v1.2.0

func SetFlagValidate[T Configurable](take *T, flagKey string, def T, validator func(*T) error)

func SetPair added in v1.2.0

func SetPair[K Configurable, V Configurable](take *KeyValue[K, V], envKey, flagKey string, def KeyValue[K, V])

func SetPairValidate added in v1.2.0

func SetPairValidate[K Configurable, V Configurable](take *KeyValue[K, V], envKey, flagKey string, def KeyValue[K, V], keyValidator func(*K) error, valueValidator func(*V) error, keyValueValidator func(*K, *V) error)

func SetValidate added in v1.2.0

func SetValidate[T Configurable](take *T, envKey, flagKey string, def T, validator func(*T) error)

Types

type Configurable

type Configurable interface {
	parse.Parseable
}

type KeyValue

type KeyValue[K Configurable, V Configurable] struct {
	Key   K
	Value V
}

Jump to

Keyboard shortcuts

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