flatmap

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(m map[string]string, prefix string) map[string]interface{}

Expand takes a map and a key (prefix) and expands that value into a more complex structure. This is the reverse of the Flatten operation but if origin map include slice, Expand(Flatten(map)) will lose the slice info, slice will treat as map with number key.

func Flatten

func Flatten(thing interface{}) map[string]string

Flatten takes a structure and turns into a flat map[string]string.

Within the "thing" parameter, only primitive values are allowed. Structs are not supported. Therefore, it can only be slices, maps, primitives, and any combination of those together.

See the tests for examples of what inputs are turned into.

func FlattenSlice

func FlattenSlice(thing []interface{}) map[string]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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