Documentation
¶
Index ¶
- type CharStack
- type CompactArray
- type CompactArrayIterator
- type CompactCompleteArray
- type CompactSingle
- type CompactSparseSlice
- type CompactType
- type HashView
- func (this *HashView) DelKey(key string) bool
- func (this *HashView) FlushAll()
- func (this *HashView) Foreach(iterator interface{}, f func(key string, seq int64), n int, ...) (nextIterator interface{})
- func (this *HashView) GetKey(key string) I.Structures
- func (this *HashView) GetKeyString(keyRef interface{}) (key string, ok bool)
- func (this *HashView) Name() string
- func (this *HashView) SetKey(key string, s I.Structures) bool
- func (this *HashView) UpdateKey(key string, s I.Structures)
- type ListView
- func (this *ListView) CmdR_Keys(pattern string) (keys []string)
- func (this *ListView) CmdW_DKeys(pattern string) (n int)
- func (this *ListView) DelKey(key string) bool
- func (this *ListView) FlushAll()
- func (this *ListView) Foreach(iterator interface{}, f func(key string, seq int64), n int, ...) (nextIterator interface{})
- func (this *ListView) GetKey(key string) I.Structures
- func (this *ListView) GetKeyString(keyRef interface{}) (key string, ok bool)
- func (this *ListView) Name() string
- func (this *ListView) SetKey(key string, s I.Structures) bool
- func (this *ListView) UpdateKey(key string, s I.Structures)
- type TrieDfsIterator
- type TrieNode
- type TrieTree
- func (this *TrieTree) DeleteNode(node *TrieNode)
- func (this *TrieTree) DeleteTree(root *TrieNode)
- func (this *TrieTree) DumpTrie(pos *TrieNode, deep int, pss *[]string)
- func (this *TrieTree) FindNode(root *TrieNode, b []byte) (node *TrieNode)
- func (this *TrieTree) FindVirtualNode(root *TrieNode, b []byte) (offset int, node *TrieNode)
- func (this *TrieTree) InsertNode(v interface{}, suffix []byte, update bool) (*TrieNode, bool)
- func (this *TrieTree) IteratorNode(root *TrieNode, b []byte, cb func(int, interface{}))
- type TrieView
- func (this *TrieView) CmdR_DBSize() (n int64)
- func (this *TrieView) CmdR_DumpTrie(prefix string) []string
- func (this *TrieView) CmdR_Keys(prefix string) (ss []string)
- func (this *TrieView) CmdR_LSKey(key string, delim string) (subkey string)
- func (this *TrieView) CmdR_Scan(nKeys, offset int64) []string
- func (this *TrieView) CmdW_PrefixDel(prefix string) bool
- func (this *TrieView) DelKey(key string) bool
- func (this *TrieView) FlushAll()
- func (this *TrieView) Foreach(iterator interface{}, f func(key string, seq int64), n int, ...) (nextIterator interface{})
- func (this *TrieView) GetKey(key string) I.Structures
- func (this *TrieView) GetKeyString(keyRef interface{}) (key string, ok bool)
- func (this *TrieView) Name() string
- func (this *TrieView) SetKey(key string, s I.Structures) bool
- func (this *TrieView) UpdateKey(key string, s I.Structures)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompactArray ¶
type CompactArray struct { Type CompactType Impl interface{} }
func NewCompactArray ¶
func NewCompactArray() *CompactArray
func (*CompactArray) Clear ¶
func (this *CompactArray) Clear()
func (*CompactArray) GetCh ¶
func (this *CompactArray) GetCh(child *TrieNode) byte
func (*CompactArray) GetChild ¶
func (this *CompactArray) GetChild(ch byte) *TrieNode
func (*CompactArray) GetNextChild ¶
func (this *CompactArray) GetNextChild(begin byte) (*TrieNode, byte)
char >= begin
func (*CompactArray) SetChild ¶
func (this *CompactArray) SetChild(ch byte, child *TrieNode)
type CompactArrayIterator ¶
type CompactArrayIterator struct { Value *TrieNode // contains filtered or unexported fields }
func NewCompactArrayIterator ¶
func NewCompactArrayIterator(self *CompactArray) (itr *CompactArrayIterator)
func (*CompactArrayIterator) IsValid ¶
func (this *CompactArrayIterator) IsValid() bool
func (*CompactArrayIterator) Next ¶
func (this *CompactArrayIterator) Next()
type CompactCompleteArray ¶
type CompactCompleteArray struct {
// contains filtered or unexported fields
}
func (*CompactCompleteArray) GetChild ¶
func (this *CompactCompleteArray) GetChild(ch byte) *TrieNode
func (*CompactCompleteArray) GetNextChild ¶
func (this *CompactCompleteArray) GetNextChild(ch byte) (*TrieNode, byte)
func (*CompactCompleteArray) SetChild ¶
func (this *CompactCompleteArray) SetChild(ch byte, child *TrieNode)
type CompactSingle ¶
type CompactSingle struct {
// contains filtered or unexported fields
}
func (*CompactSingle) GetChild ¶
func (this *CompactSingle) GetChild(ch byte) *TrieNode
func (*CompactSingle) GetNextChild ¶
func (this *CompactSingle) GetNextChild(ch byte) (*TrieNode, byte)
func (*CompactSingle) SetChild ¶
func (this *CompactSingle) SetChild(ch byte, child *TrieNode) bool
type CompactSparseSlice ¶
type CompactSparseSlice struct {
// contains filtered or unexported fields
}
func (*CompactSparseSlice) GetChild ¶
func (this *CompactSparseSlice) GetChild(ch byte) *TrieNode
func (*CompactSparseSlice) GetNextChild ¶
func (this *CompactSparseSlice) GetNextChild(ch byte) (*TrieNode, byte)
func (*CompactSparseSlice) SetChild ¶
func (this *CompactSparseSlice) SetChild(ch byte, child *TrieNode) bool
type HashView ¶
type HashView struct {
// contains filtered or unexported fields
}
func (*HashView) Foreach ¶
func (*HashView) GetKey ¶
func (this *HashView) GetKey(key string) I.Structures
func (*HashView) GetKeyString ¶
func (*HashView) UpdateKey ¶
func (this *HashView) UpdateKey(key string, s I.Structures)
type ListView ¶
type ListView struct {
// contains filtered or unexported fields
}
func (*ListView) CmdR_Keys ¶
Get some key name by pattern
func (*ListView) CmdW_DKeys ¶
Delete some key by pattern
func (*ListView) Foreach ¶
func (*ListView) GetKey ¶
func (this *ListView) GetKey(key string) I.Structures
func (*ListView) GetKeyString ¶
func (*ListView) UpdateKey ¶
func (this *ListView) UpdateKey(key string, s I.Structures)
type TrieDfsIterator ¶
type TrieDfsIterator struct { Value *TrieNode // contains filtered or unexported fields }
深度优先遍历迭代器
func NewTrieDfsIterator ¶
func NewTrieDfsIterator(root *TrieNode) *TrieDfsIterator
func (*TrieDfsIterator) Key ¶
func (this *TrieDfsIterator) Key() string
func (*TrieDfsIterator) Next ¶
func (this *TrieDfsIterator) Next() bool
func (*TrieDfsIterator) SkipNext ¶
func (this *TrieDfsIterator) SkipNext(key []byte) bool
type TrieNode ¶
type TrieNode struct { Value interface{} // contains filtered or unexported fields }
Trie树的节点
func FindLongestSubNode ¶
E.g: |A -> BC| find by |ABD| returns (1, &A); E.g: |A -> BC| find by |ABC| returns (3, &BC); @returns: 匹配深度(字符长度), 匹配的节点.
type TrieTree ¶
type TrieTree struct {
Root *TrieNode
}
Trie树主结构
func (*TrieTree) FindNode ¶
func (*TrieTree) FindVirtualNode ¶
func (*TrieTree) InsertNode ¶
type TrieView ¶
type TrieView struct {
// contains filtered or unexported fields
}
func (*TrieView) CmdR_LSKey ¶
Longest sub key
func (*TrieView) Foreach ¶
func (*TrieView) GetKey ¶
func (this *TrieView) GetKey(key string) I.Structures
func (*TrieView) GetKeyString ¶
func (*TrieView) UpdateKey ¶
func (this *TrieView) UpdateKey(key string, s I.Structures)
Click to show internal directories.
Click to hide internal directories.