Versions in this module Expand all Collapse all v0 v0.2.0 Jul 7, 2014 Changes in this version + var ErrInSequence = fmt.Errorf("Currently expecting a key sequence") + var ErrNoMatch = fmt.Errorf("Could not match key to any action") + func EachDepth(t Trie, proc func(Node) bool) + func EachWidth(t Trie, proc func(Node) bool) + type Key struct + Ch rune + Key termbox.Key + Modifier ModifierKey + func NewKeyFromKey(k termbox.Key) Key + func (k Key) Compare(x Key) int + func (k Key) String() string + type KeyList []Key + func ToKeyList(ksk string) (KeyList, error) + func (k KeyList) Equals(x KeyList) bool + func (kl KeyList) String() string + type Keyseq struct + func New() *Keyseq + func (k *Keyseq) AcceptKey(key Key) (interface{}, error) + func (k *Keyseq) CancelChain() + func (k *Keyseq) Current() keyseqMatcher + func (k *Keyseq) InMiddleOfChain() bool + type Match struct + Index int + Pattern KeyList + Value interface{} + type Matcher struct + func NewMatcher() *Matcher + func (m *Matcher) Add(pattern KeyList, v interface{}) + func (m *Matcher) Clear() + func (m *Matcher) Compile() error + func (m *Matcher) Match(text KeyList) <-chan Match + type ModifierKey int + const ModAlt + const ModMax + const ModNone + func ToKey(key string) (k termbox.Key, modifier ModifierKey, ch rune, err error) + func (m ModifierKey) String() string + type Node interface + Dig func(k Key) (Node, bool) + Each func(func(Node) bool) + Get func(k Key) Node + GetList func(k KeyList) Node + HasChildren func() bool + Label func() Key + RemoveAll func() + SetValue func(v interface{}) + Size func() int + Value func() interface{} + func Children(n Node) []Node + func Get(t Trie, k KeyList) Node + func Put(t Trie, k KeyList, v interface{}) Node + type TernaryNode struct + func NewTernaryNode(l Key) *TernaryNode + func (n *TernaryNode) Balance() + func (n *TernaryNode) Dig(k Key) (node Node, isnew bool) + func (n *TernaryNode) Each(proc func(Node) bool) + func (n *TernaryNode) FirstChild() *TernaryNode + func (n *TernaryNode) Get(k Key) Node + func (n *TernaryNode) GetList(k KeyList) Node + func (n *TernaryNode) HasChildren() bool + func (n *TernaryNode) Label() Key + func (n *TernaryNode) RemoveAll() + func (n *TernaryNode) SetValue(v interface{}) + func (n *TernaryNode) Size() int + func (n *TernaryNode) Value() interface{} + type TernaryTrie struct + func NewTernaryTrie() *TernaryTrie + func (t *TernaryTrie) Balance() + func (t *TernaryTrie) Get(k Key) Node + func (t *TernaryTrie) GetList(k KeyList) Node + func (t *TernaryTrie) Put(k KeyList, v interface{}) Node + func (t *TernaryTrie) Root() Node + func (t *TernaryTrie) Size() int + type Trie interface + Get func(Key) Node + GetList func(KeyList) Node + Put func(KeyList, interface{}) Node + Root func() Node + Size func() int + func NewTrie() Trie