configutils

package module
v0.0.0-...-ea9fa95 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 8 Imported by: 0

README

go-configutils

Go config utils.

GoDoc

Install

go get github.com/koofr/go-configutils

Testing

go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableEnvOverride

func DisableEnvOverride() func(*LoadConfigOptions)

func EnvGetter

func EnvGetter(envGetter envigo.EnvGetter) func(*LoadConfigOptions)

func EnvPrefix

func EnvPrefix(envPrefix string) func(*LoadConfigOptions)

func LoadConfig

func LoadConfig(configFile string, config interface{}, optFuncs ...func(*LoadConfigOptions)) (err error)

func LoadConfigBytes

func LoadConfigBytes(configFileBytes []byte, config interface{}, optFuncs ...func(*LoadConfigOptions)) (err error)

func LoadConfigFile

func LoadConfigFile(configFile string, config interface{}) (err error)

func OverrideConfigBytes

func OverrideConfigBytes(configBytes []byte) func(*LoadConfigOptions)

func OverrideConfigFile

func OverrideConfigFile(configFile string) func(*LoadConfigOptions)

func YAMLKeepRootKeys

func YAMLKeepRootKeys(b []byte, keys ...string) []byte

func YAMLPatchBytes

func YAMLPatchBytes(patch func(b []byte) []byte) func(*LoadConfigOptions)

func YAMLRemoveRootKeys

func YAMLRemoveRootKeys(b []byte, keys ...string) []byte

func YAMLValidateKeys

func YAMLValidateKeys(validate bool) func(*LoadConfigOptions)

Types

type LoadConfigOptions

type LoadConfigOptions struct {
	EnvOverride         bool
	EnvPrefix           string
	EnvGetter           envigo.EnvGetter
	OverrideConfigFiles []string
	OverrideConfigBytes [][]byte
	YAMLValidateKeys    bool
	YAMLPatchBytes      func(b []byte) []byte
}

Jump to

Keyboard shortcuts

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