view

package
v0.0.0-...-70491fa Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharStack

type CharStack struct {
	// contains filtered or unexported fields
}

字符栈

func NewCharStack

func NewCharStack() *CharStack

func (*CharStack) Clear

func (this *CharStack) Clear()

func (*CharStack) Pop

func (this *CharStack) Pop() byte

func (*CharStack) PopN

func (this *CharStack) PopN(n int) []byte

func (*CharStack) Push

func (this *CharStack) Push(ch byte)

func (*CharStack) PushN

func (this *CharStack) PushN(b []byte)

func (*CharStack) String

func (this *CharStack) String() string

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 CompactType

type CompactType byte

压缩的childs结构

type HashView

type HashView struct {
	// contains filtered or unexported fields
}

func (*HashView) DelKey

func (this *HashView) DelKey(key string) bool

func (*HashView) FlushAll

func (this *HashView) FlushAll()

func (*HashView) Foreach

func (this *HashView) Foreach(iterator interface{}, f func(key string, seq int64), n int, greaterThanSeq int64) (nextIterator interface{})

func (*HashView) GetKey

func (this *HashView) GetKey(key string) I.Structures

func (*HashView) GetKeyString

func (this *HashView) GetKeyString(keyRef interface{}) (key string, ok bool)

func (*HashView) Name

func (this *HashView) Name() string

func (*HashView) SetKey

func (this *HashView) SetKey(key string, s I.Structures) bool

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

func (this *ListView) CmdR_Keys(pattern string) (keys []string)

Get some key name by pattern

func (*ListView) CmdW_DKeys

func (this *ListView) CmdW_DKeys(pattern string) (n int)

Delete some key by pattern

func (*ListView) DelKey

func (this *ListView) DelKey(key string) bool

func (*ListView) FlushAll

func (this *ListView) FlushAll()

func (*ListView) Foreach

func (this *ListView) Foreach(iterator interface{}, f func(key string, seq int64), n int, greaterThanSeq int64) (nextIterator interface{})

func (*ListView) GetKey

func (this *ListView) GetKey(key string) I.Structures

func (*ListView) GetKeyString

func (this *ListView) GetKeyString(keyRef interface{}) (key string, ok bool)

func (*ListView) Name

func (this *ListView) Name() string

func (*ListView) SetKey

func (this *ListView) SetKey(key string, s I.Structures) bool

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

func FindLongestSubNode(root *TrieNode, b []byte) (deep int, node *TrieNode)

E.g: |A -> BC| find by |ABD| returns (1, &A); E.g: |A -> BC| find by |ABC| returns (3, &BC); @returns: 匹配深度(字符长度), 匹配的节点.

func NewTrieNode

func NewTrieNode() *TrieNode

func (*TrieNode) CanCombine

func (this *TrieNode) CanCombine() bool

是否可以和子节点合并

func (*TrieNode) GetTailByOffset

func (this *TrieNode) GetTailByOffset(offset int) []byte

func (*TrieNode) GetValueByOffset

func (this *TrieNode) GetValueByOffset(offset int) interface{}

func (*TrieNode) HasChild

func (this *TrieNode) HasChild() bool

func (*TrieNode) InsertTailAtBefore

func (this *TrieNode) InsertTailAtBefore(tail []byte)

func (*TrieNode) IsRoot

func (this *TrieNode) IsRoot() bool

type TrieTree

type TrieTree struct {
	Root *TrieNode
}

Trie树主结构

func NewTrieTree

func NewTrieTree() *TrieTree

func (*TrieTree) DeleteNode

func (this *TrieTree) DeleteNode(node *TrieNode)

func (*TrieTree) DeleteTree

func (this *TrieTree) DeleteTree(root *TrieNode)

func (*TrieTree) DumpTrie

func (this *TrieTree) DumpTrie(pos *TrieNode, deep int, pss *[]string)

func (*TrieTree) FindNode

func (this *TrieTree) FindNode(root *TrieNode, b []byte) (node *TrieNode)

func (*TrieTree) FindVirtualNode

func (this *TrieTree) FindVirtualNode(root *TrieNode, b []byte) (offset int, node *TrieNode)

func (*TrieTree) InsertNode

func (this *TrieTree) InsertNode(v interface{}, suffix []byte, update bool) (*TrieNode, bool)

func (*TrieTree) IteratorNode

func (this *TrieTree) IteratorNode(root *TrieNode, b []byte, cb func(int, interface{}))

type TrieView

type TrieView struct {
	// contains filtered or unexported fields
}

func (*TrieView) CmdR_DBSize

func (this *TrieView) CmdR_DBSize() (n int64)

func (*TrieView) CmdR_DumpTrie

func (this *TrieView) CmdR_DumpTrie(prefix string) []string

func (*TrieView) CmdR_Keys

func (this *TrieView) CmdR_Keys(prefix string) (ss []string)

func (*TrieView) CmdR_LSKey

func (this *TrieView) CmdR_LSKey(key string, delim string) (subkey string)

Longest sub key

func (*TrieView) CmdR_Scan

func (this *TrieView) CmdR_Scan(nKeys, offset int64) []string

func (*TrieView) CmdW_PrefixDel

func (this *TrieView) CmdW_PrefixDel(prefix string) bool

func (*TrieView) DelKey

func (this *TrieView) DelKey(key string) bool

func (*TrieView) FlushAll

func (this *TrieView) FlushAll()

func (*TrieView) Foreach

func (this *TrieView) Foreach(iterator interface{}, f func(key string, seq int64), n int, greaterThanSeq int64) (nextIterator interface{})

func (*TrieView) GetKey

func (this *TrieView) GetKey(key string) I.Structures

func (*TrieView) GetKeyString

func (this *TrieView) GetKeyString(keyRef interface{}) (key string, ok bool)

func (*TrieView) Name

func (this *TrieView) Name() string

func (*TrieView) SetKey

func (this *TrieView) SetKey(key string, s I.Structures) bool

func (*TrieView) UpdateKey

func (this *TrieView) UpdateKey(key string, s I.Structures)

Jump to

Keyboard shortcuts

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