config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 5

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 GetTruncated added in v1.5.0

func GetTruncated(valueDescriptor *Descriptor, value any) string

func Int

func Int(environmentVariable string) *intBuilder

func LoadConfig

func LoadConfig(values []Value) error

func LoadConfigWithOptions added in v1.3.0

func LoadConfigWithOptions(values []Value, options *LoadConfigOptions) error

func MaskSensitiveString added in v1.5.1

func MaskSensitiveString(valueDescriptor *Descriptor, value string) string

func Print

func Print()

func Set

func Set() *valueSetter

func String

func String(environmentVariable string) *stringBuilder

func StringArray added in v1.4.0

func StringArray(environmentVariable string) *stringArrayBuilder

Types

type Descriptor

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

type LoadConfigOptions added in v1.3.0

type LoadConfigOptions struct {
	DotEnvFile  string
	DotEnvFiles []string
}

type TypeInfo

type TypeInfo struct {
	Type ValueType
}

type Value

type Value interface {
	Descriptor() *Descriptor
}

type ValueType

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

Jump to

Keyboard shortcuts

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