Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMismatchEvent = errors.New("mismatched event")
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
EventName string `json:"name"`
EventVersion int `json:"version"`
BlockHeight int64 `json:"height"`
EventUUID string `json:"uuid"`
}
Base is a JSON-compatible rdbprojectionbase event with sequence and EventUUID support. It is not a must to use this as rdbprojectionbase event but to implement your own one rdbprojectionbase on your design
func NewBase ¶
func NewBase(params BaseParams) Base
type BaseParams ¶
type Event ¶
type Event interface {
Height() int64
Name() string
Version() int
// UUID returns the unique ID that is assigned on event creation
UUID() string
// ToJSON encodes the event into JSON string payload
ToJSON() (string, error)
// String function returns the stringified event
String() string
}
Event must be JSON-completed. i.e. All important fields must be encoded to JSON
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) DecodeByType ¶
func (*Registry) IsRegistered ¶
IsRegister returns true when the event to decoder mapping is already registered
type Store ¶
type Store interface {
// GetLatestEventHeight returns latest event height, nil if no event is stored
GetLatestHeight() (*int64, error)
GetAllByHeight(height int64) ([]Event, error)
Insert(evt Event) error
// InsertAll insert all events into store. It will rollback when the insert fails at any point.
InsertAll(evt []Event) error
}
Click to show internal directories.
Click to hide internal directories.