Documentation ¶
Overview ¶
Package gera implements a hierarchical key-value store.
A gera.Map uses a map[string]interface{} as backing store, and it can wrap other gera.Map instances. Values in child maps override any value provided by a gera.Map that's wrapped in the hierarchy.
Index ¶
- func FlattenStack(stringMaps ...StringMap) (flattened map[string]string, err error)
- type Map
- type StringMap
- type StringWrapMap
- func (w *StringWrapMap) Copy() StringMap
- func (w *StringWrapMap) Del(key string) (ok bool)
- func (w *StringWrapMap) Flattened() (map[string]string, error)
- func (w *StringWrapMap) FlattenedParent() (map[string]string, error)
- func (w *StringWrapMap) Get(key string) (value string, ok bool)
- func (w *StringWrapMap) Has(key string) bool
- func (w *StringWrapMap) HierarchyContains(m StringMap) bool
- func (w *StringWrapMap) IsHierarchyRoot() bool
- func (w *StringWrapMap) Len() int
- func (w *StringWrapMap) Raw() map[string]string
- func (w *StringWrapMap) RawCopy() map[string]string
- func (w *StringWrapMap) Set(key string, value string) (ok bool)
- func (w *StringWrapMap) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (w *StringWrapMap) Unwrap() StringMap
- func (w *StringWrapMap) Wrap(m StringMap) StringMap
- func (w *StringWrapMap) WrappedAndFlattened(m StringMap) (map[string]string, error)
- type WrapMap
- func (w *WrapMap) Flattened() (map[string]interface{}, error)
- func (w *WrapMap) Get(key string) (value interface{}, ok bool)
- func (w *WrapMap) Has(key string) bool
- func (w *WrapMap) HierarchyContains(m Map) bool
- func (w *WrapMap) IsHierarchyRoot() bool
- func (w *WrapMap) Len() int
- func (w *WrapMap) Raw() map[string]interface{}
- func (w *WrapMap) Set(key string, value interface{}) (ok bool)
- func (w *WrapMap) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (w *WrapMap) Unwrap() Map
- func (w *WrapMap) Wrap(m Map) Map
- func (w *WrapMap) WrappedAndFlattened(m Map) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Map ¶
type Map interface { Wrap(m Map) Map IsHierarchyRoot() bool HierarchyContains(m Map) bool Unwrap() Map Has(key string) bool Len() int Get(key string) (interface{}, bool) Set(key string, value interface{}) bool Flattened() (map[string]interface{}, error) WrappedAndFlattened(m Map) (map[string]interface{}, error) Raw() map[string]interface{} }
func MakeMapWithMap ¶
func MakeMapWithMapCopy ¶
type StringMap ¶
type StringMap interface { Wrap(m StringMap) StringMap IsHierarchyRoot() bool HierarchyContains(m StringMap) bool Unwrap() StringMap Has(key string) bool Len() int Get(key string) (string, bool) Set(key string, value string) bool Del(key string) bool Flattened() (map[string]string, error) FlattenedParent() (map[string]string, error) WrappedAndFlattened(m StringMap) (map[string]string, error) Raw() map[string]string Copy() StringMap RawCopy() map[string]string }
type StringWrapMap ¶
type StringWrapMap struct {
// contains filtered or unexported fields
}
func MakeStringMap ¶
func MakeStringMap() *StringWrapMap
func MakeStringMapWithMap ¶
func MakeStringMapWithMap(fromMap map[string]string) *StringWrapMap
func MakeStringMapWithMapCopy ¶
func MakeStringMapWithMapCopy(fromMap map[string]string) *StringWrapMap
func (*StringWrapMap) Copy ¶
func (w *StringWrapMap) Copy() StringMap
func (*StringWrapMap) Del ¶ added in v0.26.2
func (w *StringWrapMap) Del(key string) (ok bool)
func (*StringWrapMap) FlattenedParent ¶
func (w *StringWrapMap) FlattenedParent() (map[string]string, error)
func (*StringWrapMap) Has ¶
func (w *StringWrapMap) Has(key string) bool
func (*StringWrapMap) HierarchyContains ¶
func (w *StringWrapMap) HierarchyContains(m StringMap) bool
func (*StringWrapMap) IsHierarchyRoot ¶
func (w *StringWrapMap) IsHierarchyRoot() bool
func (*StringWrapMap) Len ¶
func (w *StringWrapMap) Len() int
func (*StringWrapMap) Raw ¶
func (w *StringWrapMap) Raw() map[string]string
func (*StringWrapMap) RawCopy ¶ added in v0.82.2
func (w *StringWrapMap) RawCopy() map[string]string
func (*StringWrapMap) UnmarshalYAML ¶
func (w *StringWrapMap) UnmarshalYAML(unmarshal func(interface{}) error) error
func (*StringWrapMap) Unwrap ¶
func (w *StringWrapMap) Unwrap() StringMap
Unwraps this map from its parent. Returns a pointer to the former parent which was just unwrapped.
func (*StringWrapMap) Wrap ¶
func (w *StringWrapMap) Wrap(m StringMap) StringMap
Wraps this map around the gera.Map m, which becomes the new parent. Returns a pointer to the composite map (i.e. to itself in its new state).
func (*StringWrapMap) WrappedAndFlattened ¶
func (w *StringWrapMap) WrappedAndFlattened(m StringMap) (map[string]string, error)
type WrapMap ¶
type WrapMap struct {
// contains filtered or unexported fields
}
func (*WrapMap) HierarchyContains ¶
func (*WrapMap) IsHierarchyRoot ¶
func (*WrapMap) UnmarshalYAML ¶
func (*WrapMap) Unwrap ¶
Unwraps this map from its parent. Returns a pointer to the former parent which was just unwrapped.
Click to show internal directories.
Click to hide internal directories.