parameters

package
v0.8.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 5 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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