Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeTxMsg(msg *TxMsg) ([]byte, error)
- func EncodeViewMsg(msg *ViewMsg) ([]byte, error)
- func IsNoDataError(err error) bool
- func LoadModuleConfigFile(filePath string, modCfg interface{}) (err error)
- 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
- func Unsubscribe(scope EventScope, path EventPath, name string)
- func WriteModuleConfigFile(filePath string, modCfg ModuleConfig) (err error)
- type Client
- type Codec
- type EmptyModuleConfig
- type Event
- type EventBus
- type EventBusRegistry
- func (registry *EventBusRegistry) Publish(scope EventScope, event Event) error
- func (registry *EventBusRegistry) RegisterEventBus(scope EventScope) *EventBus
- func (registry *EventBusRegistry) Subscribe(scope EventScope, path EventPath, name string, handler EventHandler) error
- func (registry *EventBusRegistry) Unsubscribe(scope EventScope, path EventPath, name string)
- type EventHandler
- type EventPath
- type EventRouter
- type EventScope
- type KVHandler
- type KeyValue
- type ModuleConfig
- type NoDataError
- 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 LoadModuleConfigFile ¶ added in v0.0.2
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 ¶
func Unsubscribe ¶ added in v0.0.2
func Unsubscribe(scope EventScope, path EventPath, name string)
func WriteModuleConfigFile ¶ added in v0.0.2
func WriteModuleConfigFile(filePath string, modCfg ModuleConfig) (err error)
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) CurrentBlockNumber() (block int64) }
type EmptyModuleConfig ¶ added in v0.0.2
type EmptyModuleConfig struct { }
func (EmptyModuleConfig) GetTemplate ¶ added in v0.0.2
func (e EmptyModuleConfig) GetTemplate() string
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 EventBusRegistry ¶ added in v0.0.2
type EventBusRegistry struct {
// contains filtered or unexported fields
}
func (*EventBusRegistry) Publish ¶ added in v0.0.2
func (registry *EventBusRegistry) Publish(scope EventScope, event Event) error
func (*EventBusRegistry) RegisterEventBus ¶ added in v0.0.2
func (registry *EventBusRegistry) RegisterEventBus(scope EventScope) *EventBus
func (*EventBusRegistry) Subscribe ¶ added in v0.0.2
func (registry *EventBusRegistry) Subscribe(scope EventScope, path EventPath, name string, handler EventHandler) error
func (*EventBusRegistry) Unsubscribe ¶ added in v0.0.2
func (registry *EventBusRegistry) Unsubscribe(scope EventScope, path EventPath, name string)
type EventHandler ¶
type EventHandler func(event Event)
type EventRouter ¶ added in v0.0.2
func NewEventRouter ¶ added in v0.0.2
func NewEventRouter(path EventPath) *EventRouter
func (*EventRouter) Add ¶ added in v0.0.2
func (router *EventRouter) Add(name string, handler EventHandler) error
func (*EventRouter) PushEvent ¶ added in v0.0.2
func (router *EventRouter) PushEvent(event Event)
func (*EventRouter) Remove ¶ added in v0.0.2
func (router *EventRouter) Remove(name string)
type EventScope ¶
type EventScope string
type ModuleConfig ¶ added in v0.0.2
type ModuleConfig interface {
GetTemplate() 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.