Documentation ¶
Index ¶
- type Aggregator
- type InvParam
- type Node
- func (n *Node) AddAggregator(aggr *Aggregator)
- func (n *Node) AddChild(key string, node *Node)
- func (n *Node) Aggregator() *Aggregator
- func (n *Node) ChildCount() int
- func (n *Node) FindNextAggregatedNode() *Node
- func (n *Node) FindNextAggregatedNodeWithKey() ([]string, *Node)
- func (n *Node) FirstChild() *Node
- func (n *Node) FirstChildWithKey() (string, *Node)
- func (n *Node) GetChild(key string) *Node
- func (n *Node) HasAggregator() bool
- func (n *Node) HasChildren() bool
- type ParamValue
- type PunctuationSplitter
- type Splitter
- type Trie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
Aggregator struct holding various inventory param values
func (*Aggregator) Add ¶
func (a *Aggregator) Add(param InvParam, val int64)
Add adds inv parameter value to aggregation
func (*Aggregator) Clone ¶
func (a *Aggregator) Clone() *Aggregator
Clone creates a copy of aggregator
type InvParam ¶
type InvParam uint
InvParam represent type or inventory parameter
func (InvParam) MarshalText ¶
MarshalText renders InvParam as a string when marshalling
func (*InvParam) UnmarshalText ¶
UnmarshalText decodes InvParam value from string
type Node ¶
type Node struct { Children map[string]*Node `json:"Children,omitempty"` Aggr *Aggregator `json:"Values,omitempty"` OverflowChildrenCount uint64 `json:"Overflow,omitempty"` // contains filtered or unexported fields }
Node node of the trie
func (*Node) AddAggregator ¶
func (n *Node) AddAggregator(aggr *Aggregator)
AddAggregator adds aggregator
func (*Node) Aggregator ¶
func (n *Node) Aggregator() *Aggregator
Aggregator Returns aggregator attached to the node
func (*Node) FindNextAggregatedNode ¶
FindNextAggregatedNode descends down trie branch till the next node with aggregator
func (*Node) FindNextAggregatedNodeWithKey ¶
FindNextAggregatedNodeWithKey descends down trie branch till the next node with aggregator and returns key path to it
func (*Node) FirstChild ¶
FirstChild returns child node, panics if there are no child nodes
func (*Node) FirstChildWithKey ¶
FirstChildWithKey return child node and its key, panics if there are no child nodes
func (*Node) GetChild ¶
GetChild returns a child node by provided key, if key doesn't exist returns nil
func (*Node) HasAggregator ¶
HasAggregator returns if the node has aggregator attached
func (*Node) HasChildren ¶
HasChildren returns if the node has at least one child node
type ParamValue ¶
ParamValue value for inventory param
type PunctuationSplitter ¶
type PunctuationSplitter struct {
// contains filtered or unexported fields
}
PunctuationSplitter splitting keys by a specific set of symbols (i.e. punctuation)
func NewPunctuationSplitter ¶
func NewPunctuationSplitter(punctuation ...rune) *PunctuationSplitter
NewPunctuationSplitter creates PunctuationSplitter
func (*PunctuationSplitter) Split ¶
func (s *PunctuationSplitter) Split(in string) []string
Split splits string key to fragments with given strategy
type Splitter ¶
type Splitter interface { // Split splits string key to fragments with given strategy Split(in string) []string }
Splitter abstraction to split string in fragments