config

package
v1.87.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSONReader = json.Unmarshal
	TOMLReader = toml.Unmarshal
	YAMLReader = func(data []byte, o interface{}) error { return yaml.Unmarshal(data, o) }
)

Functions

func Read

func Read(obj interface{}, configFiles ...string) error

Read deserializes each config file to the target obj using a Reader (depending on file extension) env vars are replaced in the config file as well as the file path

Types

type ArrayFlags

type ArrayFlags struct {
	// contains filtered or unexported fields
}

ArrayFlags implements the flag/Value interface allowing to set multiple string flags with the same name

func NewArrayFlags

func NewArrayFlags(defaults ...string) *ArrayFlags

func (*ArrayFlags) Set

func (i *ArrayFlags) Set(value string) error

func (*ArrayFlags) String

func (i *ArrayFlags) String() string

func (*ArrayFlags) Values

func (i *ArrayFlags) Values() []string

type ReaderFunc

type ReaderFunc func(data []byte, o interface{}) error

type ValidatableConfiguration

type ValidatableConfiguration interface {
	Validate() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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