Documentation ¶
Index ¶
- Constants
- type TopicTrie
- func (trie *TopicTrie) CountNodes() int
- func (trie *TopicTrie) GetLevel() int
- func (trie *TopicTrie) GetTopic() string
- func (trie *TopicTrie) Insert(parts []string, value interface{}) *TopicTrie
- func (trie *TopicTrie) IsEnded() bool
- func (trie *TopicTrie) MatchMany(topicParts []string) []*TopicTrie
- func (trie *TopicTrie) MatchOne(topicParts []string) *TopicTrie
- func (trie *TopicTrie) Remove(parts []string) bool
- func (trie *TopicTrie) SearchPrefix(parts []string) *TopicTrie
Constants ¶
View Source
const MULTI_WILDCARD = "#"
View Source
const SINGLE_WILDCARD = "+"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TopicTrie ¶
type TopicTrie struct { Value interface{} // contains filtered or unexported fields }
支持通配符的字典树
func NewRootTopicTrie ¶
func NewRootTopicTrie() *TopicTrie
func (*TopicTrie) CountNodes ¶
func (*TopicTrie) SearchPrefix ¶
寻找字典树中层级与某个topic最接近的前缀节点
Click to show internal directories.
Click to hide internal directories.