Documentation
¶
Index ¶
- func BytesToUint64(data []byte) uint64
- func GetFixedSizeBytes(size int, str string) []byte
- func StrToBytes(s string) []byte
- func Uint64ToBytes(n uint64) []byte
- type Counter
- type Event
- type EventStore
- func (eventstore *EventStore) Close()
- func (eventstore *EventStore) GetStore(storeName string) (*Store, error)
- func (eventstore *EventStore) RecoverSnapshot(store *Store) error
- func (eventstore *EventStore) SetSnapshotHandler(fn func(*SnapshotRequest) error)
- func (eventstore *EventStore) TakeSnapshot(store *Store, seq uint64, data []byte) error
- func (eventstore *EventStore) UnregisterStore(name string)
- type Options
- type SnapshotController
- type SnapshotOptions
- type SnapshotRequest
- func (request *SnapshotRequest) Delete(collection []byte, key []byte) error
- func (request *SnapshotRequest) Get(collection []byte, key []byte) ([]byte, error)
- func (request *SnapshotRequest) UpdateDurableState(collection []byte) error
- func (request *SnapshotRequest) Upsert(collection []byte, key []byte, fn func(origin []byte) ([]byte, error)) error
- type Store
- func (store *Store) Close()
- func (store *Store) DispatchEvent()
- func (store *Store) GetColumnFamailyHandle(name string) (*gorocksdb.ColumnFamilyHandle, error)
- func (store *Store) GetDurableState(durableName string) (uint64, error)
- func (store *Store) GetLastSequence() uint64
- func (store *Store) Subscribe(durableName string, startAt uint64, fn StoreHandler) (*Subscription, error)
- func (store *Store) UpdateDurableState(durableName string, lastSeq uint64) error
- func (store *Store) Write(data []byte) (uint64, error)
- type StoreHandler
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUint64 ¶
func GetFixedSizeBytes ¶
func StrToBytes ¶
func Uint64ToBytes ¶
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
func CreateEventStore ¶
func CreateEventStore(options *Options) (*EventStore, error)
func (*EventStore) Close ¶
func (eventstore *EventStore) Close()
func (*EventStore) GetStore ¶
func (eventstore *EventStore) GetStore(storeName string) (*Store, error)
func (*EventStore) RecoverSnapshot ¶ added in v0.0.2
func (eventstore *EventStore) RecoverSnapshot(store *Store) error
func (*EventStore) SetSnapshotHandler ¶
func (eventstore *EventStore) SetSnapshotHandler(fn func(*SnapshotRequest) error)
func (*EventStore) TakeSnapshot ¶
func (eventstore *EventStore) TakeSnapshot(store *Store, seq uint64, data []byte) error
func (*EventStore) UnregisterStore ¶
func (eventstore *EventStore) UnregisterStore(name string)
type Options ¶
type Options struct {
DatabasePath string
EnabledSnapshot bool
RocksdbOptions *gorocksdb.Options
SnapshotOptions *SnapshotOptions
}
func NewOptions ¶
func NewOptions() *Options
type SnapshotController ¶
type SnapshotController struct {
// contains filtered or unexported fields
}
func NewSnapshotController ¶
func NewSnapshotController(options *SnapshotOptions) *SnapshotController
func (*SnapshotController) RecoverSnapshot ¶ added in v0.0.2
func (ss *SnapshotController) RecoverSnapshot(store *Store) error
func (*SnapshotController) Request ¶
func (ss *SnapshotController) Request(store *Store, seq uint64, data []byte) error
func (*SnapshotController) SetHandler ¶
func (ss *SnapshotController) SetHandler(fn func(*SnapshotRequest) error)
type SnapshotOptions ¶
func NewSnapshotOptions ¶
func NewSnapshotOptions() *SnapshotOptions
type SnapshotRequest ¶
func NewSnapshotRequest ¶
func NewSnapshotRequest() *SnapshotRequest
func (*SnapshotRequest) Delete ¶
func (request *SnapshotRequest) Delete(collection []byte, key []byte) error
func (*SnapshotRequest) Get ¶
func (request *SnapshotRequest) Get(collection []byte, key []byte) ([]byte, error)
func (*SnapshotRequest) UpdateDurableState ¶ added in v0.0.2
func (request *SnapshotRequest) UpdateDurableState(collection []byte) error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DispatchEvent ¶
func (store *Store) DispatchEvent()
func (*Store) GetColumnFamailyHandle ¶
func (store *Store) GetColumnFamailyHandle(name string) (*gorocksdb.ColumnFamilyHandle, error)
func (*Store) GetDurableState ¶
func (*Store) GetLastSequence ¶
func (*Store) Subscribe ¶
func (store *Store) Subscribe(durableName string, startAt uint64, fn StoreHandler) (*Subscription, error)
func (*Store) UpdateDurableState ¶
type StoreHandler ¶
type StoreHandler func(*Event)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func NewSubscription ¶
func NewSubscription(store *Store, durableName string, startAt uint64, iterator *gorocksdb.Iterator, fn StoreHandler) *Subscription
func (*Subscription) Close ¶
func (sub *Subscription) Close()
func (*Subscription) Trigger ¶
func (sub *Subscription) Trigger() error
func (*Subscription) Watch ¶
func (sub *Subscription) Watch()
Click to show internal directories.
Click to hide internal directories.