parameters

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPrefix

func WithPrefix(prefix string) func(*Options)

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

Jump to

Keyboard shortcuts

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