예제 #1
0
// Flatten a data bag item out so it's suitable for indexing.
func (dbi *DataBagItem) Flatten() map[string]interface{} {
	flatten := make(map[string]interface{})
	for key, v := range dbi.RawData {
		subExpand := util.DeepMerge(key, v)
		for k, u := range subExpand {
			flatten[k] = u
		}
	}
	return flatten
}
예제 #2
0
파일: databag.go 프로젝트: ranjib/goiardi
// Flatten a data bag item out so it's suitable for indexing.
func (dbi *DataBagItem) Flatten() []string {
	flatten := make(map[string]interface{})
	for key, v := range dbi.RawData {
		subExpand := util.DeepMerge(key, v)
		for k, u := range subExpand {
			flatten[k] = u
		}
	}
	indexified := util.Indexify(flatten)
	return indexified
}