maps

package
v0.0.0-...-7ddf83c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxDepth = 32
)

Adapted from github.com/peterbourgon/mergemap

Functions

func CollectKeys

func CollectKeys(data map[string]interface{}, path string, max_depth int) []string

Recursively collects all keys into a flattened slice of materialized paths.

func Merge

func Merge(dst, src map[string]interface{}) map[string]interface{}

Merge recursively merges the src and dst maps. Key conflicts are resolved by preferring src, or recursively descending, if both src and dst are maps.

func ToStringMapRecursive

func ToStringMapRecursive(src map[string]interface{})

Recursively coerces all maps to a stringmap. Because that's how we want it.

func Traverse

func Traverse(data map[string]interface{}, cb Traverser)

General purpose method for traversing a string map.

Types

type Traverser

type Traverser func(key string, val interface{}, depth int) bool

A callback for Traverse. It will accept a key, a value, the current depth and return true if we should continue deeper.

Jump to

Keyboard shortcuts

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