gera

package
v0.82.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: GPL-3.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenStack

func FlattenStack(stringMaps ...StringMap) (flattened map[string]string, err error)

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 MakeMap

func MakeMap() Map

func MakeMapWithMap

func MakeMapWithMap(fromMap map[string]interface{}) Map

func MakeMapWithMapCopy

func MakeMapWithMapCopy(fromMap map[string]interface{}) Map

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) Flattened

func (w *StringWrapMap) Flattened() (map[string]string, error)

func (*StringWrapMap) FlattenedParent

func (w *StringWrapMap) FlattenedParent() (map[string]string, error)

func (*StringWrapMap) Get

func (w *StringWrapMap) Get(key string) (value string, ok bool)

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) Set

func (w *StringWrapMap) Set(key string, value string) (ok bool)

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) Flattened

func (w *WrapMap) Flattened() (map[string]interface{}, error)

func (*WrapMap) Get

func (w *WrapMap) Get(key string) (value interface{}, ok bool)

func (*WrapMap) Has

func (w *WrapMap) Has(key string) bool

func (*WrapMap) HierarchyContains

func (w *WrapMap) HierarchyContains(m Map) bool

func (*WrapMap) IsHierarchyRoot

func (w *WrapMap) IsHierarchyRoot() bool

func (*WrapMap) Len

func (w *WrapMap) Len() int

func (*WrapMap) Raw

func (w *WrapMap) Raw() map[string]interface{}

func (*WrapMap) Set

func (w *WrapMap) Set(key string, value interface{}) (ok bool)

func (*WrapMap) UnmarshalYAML

func (w *WrapMap) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*WrapMap) Unwrap

func (w *WrapMap) Unwrap() Map

Unwraps this map from its parent. Returns a pointer to the former parent which was just unwrapped.

func (*WrapMap) Wrap

func (w *WrapMap) Wrap(m Map) Map

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 (*WrapMap) WrappedAndFlattened

func (w *WrapMap) WrappedAndFlattened(m Map) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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