Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeTxMsg(msg *TxMsg) ([]byte, error)
- func EncodeViewMsg(msg *ViewMsg) ([]byte, error)
- func IsNoDataError(err error) bool
- func Publish(scope EventScope, event Event) error
- func RegisterCodec(cdc *Codec)
- func Subscribe(scope EventScope, path EventPath, name string, handler EventHandler) error
- func TxTypeString(typ TxType) string
- type Client
- type Codec
- type Command
- type CommandProcessor
- type Event
- type EventBus
- type EventHandler
- type EventPath
- type EventScope
- type KVHandler
- type KeyValue
- type NoDataError
- type Queue
- type SpaceRegistry
- type Store
- type TxMsg
- type TxType
- type ViewMsg
- func DecodeViewMsg(msgBytes []byte) (*ViewMsg, error)
- func NewViewMsgHas(space string, path string, key string) *ViewMsg
- func NewViewMsgKeys(space string, path string, start string, end string) *ViewMsg
- func NewViewMsgMany(space string, path string, start string, end string) *ViewMsg
- func NewViewMsgOne(space string, path string, key string) *ViewMsg
- type ViewType
Constants ¶
View Source
const ( Has = ViewType(0) GetOne = ViewType(1) GetMany = ViewType(2) GetKeys = ViewType(3) )
View Source
const ( TxSet = TxType(11) TxSetSync = TxType(12) TxDelete = TxType(21) TxDeleteSync = TxType(22) TxCommit = TxType(90) )
View Source
const GlobalEventScope = EventScope("")
Variables ¶
View Source
var ( LastKeySuffix = "~~~" LastKeySuffixBytes = []byte(LastKeySuffix) )
View Source
var BasicCdc = NewCodec()
BasicCdc is the basic codec
Functions ¶
func EncodeTxMsg ¶
func EncodeViewMsg ¶
func IsNoDataError ¶
func Publish ¶
func Publish(scope EventScope, event Event) error
func RegisterCodec ¶
func RegisterCodec(cdc *Codec)
RegisterCodec registers concrete types on the Amino codec
func Subscribe ¶
func Subscribe(scope EventScope, path EventPath, name string, handler EventHandler) error
func TxTypeString ¶
Types ¶
type Client ¶
type Client interface { BroadcastTxSync(msg *TxMsg) error BroadcastTxAsync(msg *TxMsg) error BroadcastTxCommit(msg *TxMsg) error Commit() error Has(msg *ViewMsg) (bool, error) Query(msg *ViewMsg) ([]byte, error) GetObject(msg *ViewMsg, obj interface{}) (err error) GetMany(msg *ViewMsg, handler KVHandler) (err error) GetKeys(msg *ViewMsg) ([]string, error) UnmarshalObject(bz []byte, ptr interface{}) error MarshalObject(ptr interface{}) ([]byte, error) UnmarshalJson(bz []byte, ptr interface{}) error MarshalJson(ptr interface{}) ([]byte, error) }
type CommandProcessor ¶
type CommandProcessor struct {
// contains filtered or unexported fields
}
type EventBus ¶
func RegisterEventBus ¶
func RegisterEventBus(scope EventScope) *EventBus
func (*EventBus) Subscribe ¶
func (bus *EventBus) Subscribe(path EventPath, name string, handler EventHandler) error
func (*EventBus) Unsubscribe ¶
type EventHandler ¶
type EventHandler func(event Event)
type EventScope ¶
type EventScope string
type NoDataError ¶
type NoDataError struct {
// contains filtered or unexported fields
}
func NewNoDataError ¶
func NewNoDataError() NoDataError
func (NoDataError) Error ¶
func (err NoDataError) Error() string
type SpaceRegistry ¶
type Store ¶
type Store interface { GetPath() string Get(key []byte) ([]byte, error) Has(key []byte) (bool, error) Set(key []byte, value []byte) error SetSync(key []byte, value []byte) error Delete(key []byte) error DeleteSync(key []byte) error Iterator(start, end []byte) (dbm.Iterator, error) GetMany(start, end []byte) (kvArrayBytes []byte, err error) }
type TxMsg ¶
func DecodeTxMsg ¶
func (*TxMsg) GetEventKey ¶
func (*TxMsg) GetTypeString ¶
Click to show internal directories.
Click to hide internal directories.