Documentation ¶
Index ¶
- func WithPrefix(prefix string) func(*Options)
- type Options
- type Parameters
- func FromFlatten(m map[string]string) (Parameters, error)
- func Load(data []byte, ops ...func(*Options)) (Parameters, error)
- func LoadFile(path string, ops ...func(*Options)) (Parameters, error)
- func LoadFiles(paths []string, ops ...func(*Options)) (Parameters, error)
- func LoadMultiple(datas [][]byte, ops ...func(*Options)) (Parameters, error)
- func Merge(parameters ...Parameters) (Parameters, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPrefix ¶
WithPrefix adds the given prefix when loading parameters
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options contains loading options for parameters
type Parameters ¶
type Parameters map[string]interface{}
Parameters represents a parameters map
func FromFlatten ¶
func FromFlatten(m map[string]string) (Parameters, error)
FromFlatten takes a flatten map and loads it as a Parameters map This uses yaml.Unmarshal to "guess" the type of the value
func Load ¶
func Load(data []byte, ops ...func(*Options)) (Parameters, error)
Load loads the given data in parameters
func LoadFile ¶
func LoadFile(path string, ops ...func(*Options)) (Parameters, error)
LoadFile loads a file (path) in parameters (i.e. flatten map)
func LoadFiles ¶
func LoadFiles(paths []string, ops ...func(*Options)) (Parameters, error)
LoadFiles loads multiple path in parameters, merging them.
func LoadMultiple ¶
func LoadMultiple(datas [][]byte, ops ...func(*Options)) (Parameters, error)
LoadMultiple loads multiple data in parameters
func Merge ¶
func Merge(parameters ...Parameters) (Parameters, error)
Merge merges multiple parameters overriding duplicated keys
func (Parameters) Flatten ¶
func (s Parameters) Flatten() map[string]string
Flatten returns a flatten view of a parameters This becomes a one-level map with keys joined with a dot
Click to show internal directories.
Click to hide internal directories.