Documentation ¶
Index ¶
- func NewNode() *proto.Node
- type Handle
- type HandleKeyStore
- type HandleTopic
- type Node
- type State
- func (t *State) Close() error
- func (t *State) HandleDeleteKeyRequest(req *proto.DeleteKeyRequest) (response []byte, err error)
- func (t *State) HandlePutKeyRequest(req *proto.PutKeyRequest) (response []byte, err error)
- func (t *State) HandlePutKeysRequest(req *proto.PutKeysRequest) (response []byte, err error)
- func (t *State) HandleSubRequest(req *proto.SubRequest) (response []byte, err error)
- func (t *State) HandleUnSubRequest(req *proto.UnSubRequest) (response []byte, err error)
- func (t *State) Lookup(i interface{}) (interface{}, error)
- func (t *State) MatchSubTopics(req *api.MatchSubTopicRequest) *api.MatchSubTopicResponse
- func (t *State) MatchTopic(req *api.MatchTopicRequest) *api.MatchTopicResponse
- func (t *State) ReadKey(key string) (string, bool, error)
- func (t *State) ReadWithPrefix(prefix string) (map[string]string, error)
- func (t *State) RecoverFromSnapshot(reader io.Reader, files []statemachine.SnapshotFile, i <-chan struct{}) error
- func (t *State) SaveSnapshot(writer io.Writer, collection statemachine.ISnapshotFileCollection, ...) error
- func (t *State) Update(bytes []byte) (statemachine.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handle ¶
type Handle interface { HandleTopic HandleKeyStore }
type HandleKeyStore ¶
type HandleKeyStore interface { HandlePutKeyRequest(req *proto.PutKeyRequest) (response []byte, err error) HandleDeleteKeyRequest(req *proto.DeleteKeyRequest) (response []byte, err error) HandlePutKeysRequest(req *proto.PutKeysRequest) (response []byte, err error) }
type HandleTopic ¶
type HandleTopic interface { HandleSubRequest(req *proto.SubRequest) (response []byte, err error) HandleUnSubRequest(req *proto.UnSubRequest) (response []byte, err error) }
type Node ¶
Node represents a node in the prefix tree.go. It contains a key-value pair and a map of child nodes. The key-value pair is stored in the leaf node. The map of child nodes is stored in the non-leaf node.
func (*Node) PrefixSearch ¶
PrefixSearch searches for all key-value pairs with keys that have the given prefix.
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) HandleDeleteKeyRequest ¶
func (t *State) HandleDeleteKeyRequest(req *proto.DeleteKeyRequest) (response []byte, err error)
func (*State) HandlePutKeyRequest ¶
func (t *State) HandlePutKeyRequest(req *proto.PutKeyRequest) (response []byte, err error)
func (*State) HandlePutKeysRequest ¶
func (t *State) HandlePutKeysRequest(req *proto.PutKeysRequest) (response []byte, err error)
func (*State) HandleSubRequest ¶
func (t *State) HandleSubRequest(req *proto.SubRequest) (response []byte, err error)
func (*State) HandleUnSubRequest ¶
func (t *State) HandleUnSubRequest(req *proto.UnSubRequest) (response []byte, err error)
func (*State) MatchSubTopics ¶
func (t *State) MatchSubTopics(req *api.MatchSubTopicRequest) *api.MatchSubTopicResponse
func (*State) MatchTopic ¶
func (t *State) MatchTopic(req *api.MatchTopicRequest) *api.MatchTopicResponse
func (*State) ReadWithPrefix ¶
func (*State) RecoverFromSnapshot ¶
func (t *State) RecoverFromSnapshot(reader io.Reader, files []statemachine.SnapshotFile, i <-chan struct{}) error
func (*State) SaveSnapshot ¶
func (t *State) SaveSnapshot(writer io.Writer, collection statemachine.ISnapshotFileCollection, i <-chan struct{}) error
Click to show internal directories.
Click to hide internal directories.