Documentation ¶
Overview ¶
Package types contains shared type definitions.
Index ¶
Constants ¶
const ( // MaxStackDepth contains the maximum number of nested projector calls that can be made without // returning. MaxStackDepth = 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Variables StackMapInterface Output *jsonutil.JSONToken TopLevelObjects map[string][]jsonutil.JSONToken Registry *Registry // contains filtered or unexported fields }
A Context stores data about variables and ancestors for a projector invocation.
func NewContext ¶
NewContext creates a new context with empty components initialized and ready to go.
func (*Context) PopProjectorFromStack ¶
PopProjectorFromStack removes one count of the given projector name from the stack trace.
func (*Context) PushProjectorToStack ¶
PushProjectorToStack adds one count of the given projector name to the stack trace.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores projectors for a mapping config to use.
func (*Registry) FindProjector ¶
FindProjector finds and returns a projector with the given name, or an error if no projector with that name exists.
type StackMap ¶
type StackMap struct {
// contains filtered or unexported fields
}
StackMap implements StackMapInterface, which acts like a layered stack of maps.
func (*StackMap) Empty ¶
Empty returns true if the StackMap contains no layers or its sole layer is empty.
func (*StackMap) Push ¶
func (s *StackMap) Push()
Push creates a new layer (empty map) in the stack.
type StackMapInterface ¶
type StackMapInterface interface { Push() Pop() (map[string]*jsonutil.JSONToken, error) Set(key string, value *jsonutil.JSONToken) error Get(key string) (*jsonutil.JSONToken, error) String() string Empty() bool }
StackMapInterface defines a layered map, that allows a new map layer to be pushed, have values added to it, then be popped and have only those values disappear from the overall map. Get() calls will scan all maps starting at the top of the stack and return the first found values.
Directories ¶
Path | Synopsis |
---|---|
Package registerall contains registerAll function that registers builtin function into projectors
|
Package registerall contains registerAll function that registers builtin function into projectors |