config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPFlag

func BindPFlag(key string, flag *pflag.Flag)

func Bool

func Bool(environmentVariable string) *boolBuilder

func Get

func Get() *applicationConfigType

func GetSanatizedDefaultValue

func GetSanatizedDefaultValue(valueDescriptor *Descriptor) string

func GetSensitiveProtectedValue

func GetSensitiveProtectedValue(valueDescriptor *Descriptor) string

func Int

func Int(environmentVariable string) *intBuilder

func LoadConfig

func LoadConfig(values []Value) error

func Print

func Print()

func Set

func Set() *valueSetter

func String

func String(environmentVariable string) *stringBuilder

Types

type Descriptor

type Descriptor struct {
	EnvionmentVariable string
	Default            any
	Provided           bool
	Value              any
	NotEmpty           bool
	Sensitive          bool
	TypeInfo           TypeInfo
}

type TypeInfo

type TypeInfo struct {
	Type ValueType
}

type Value

type Value interface {
	Descriptor() *Descriptor
}

type ValueType

type ValueType string
const (
	StringType ValueType = "string"
	BoolType   ValueType = "bool"
	IntType    ValueType = "int"
)

Jump to

Keyboard shortcuts

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