kpmap

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 2 Imported by: 0

README

Map Parser

kpmap package provides a function PopFlatten for populating a konfig.Store by flatteing a map[string]interface{}, which is used by json/toml/yaml parser.

Usage

func main() {
	var m = map[string]interface{}{
		"test": map[string]interface{}{
			"foo": "bar",
		},
		"testIface": map[interface{}]interface{}{
			1: "bar",
			"testIface": map[interface{}]interface{}{
				"foo": "bar",
			},
			"test": map[string]interface{}{
				"foo": "bar",
			},
		},
	}
	var v = konfig.Values{}
	kpmap.PopFlatten(m, v)

	fmt.Println(v) // map[test.foo:bar testIface.1:bar testIface.test.foo:bar testIface.testIface.foo:bar]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopFlatten

func PopFlatten(m map[string]interface{}, s konfig.Values)

PopFlatten populates a konfig.Store by flatteing a map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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