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 ColumnFamily
- 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 Merger
- type Options
- type Record
- 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, value []byte, fn func([]byte, []byte) []byte) error
- type SnapshotView
- type Store
- func (store *Store) Close()
- func (store *Store) CreateSnapshotView() *SnapshotView
- func (store *Store) DispatchEvent()
- func (store *Store) Fetch(startAt uint64, offset uint64, count int) ([]*Event, error)
- func (store *Store) GetColumnFamailyHandle(name string) (*ColumnFamily, 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 ColumnFamily ¶ added in v0.0.14
type ColumnFamily struct {
Store *Store
Db *pebble.DB
Name string
Merge func([]byte, []byte) []byte
// contains filtered or unexported fields
}
func NewColumnFamily ¶ added in v0.0.14
func NewColumnFamily(store *Store, name string) *ColumnFamily
func (*ColumnFamily) Close ¶ added in v0.0.14
func (cf *ColumnFamily) Close() error
func (*ColumnFamily) Open ¶ added in v0.0.14
func (cf *ColumnFamily) Open() error
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 Merger ¶ added in v0.0.15
type Merger struct {
// contains filtered or unexported fields
}
func (*Merger) MergeNewer ¶ added in v0.0.15
func (*Merger) MergeOlder ¶ added in v0.0.15
type Options ¶
type Options struct {
DatabasePath string
EnabledSnapshot bool
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 SnapshotView ¶ added in v0.0.8
type SnapshotView struct {
// contains filtered or unexported fields
}
func NewSnapshotView ¶ added in v0.0.8
func NewSnapshotView(store *Store) *SnapshotView
func (*SnapshotView) Initialize ¶ added in v0.0.8
func (sv *SnapshotView) Initialize() error
func (*SnapshotView) Release ¶ added in v0.0.8
func (sv *SnapshotView) Release() error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreateSnapshotView ¶ added in v0.0.8
func (store *Store) CreateSnapshotView() *SnapshotView
func (*Store) DispatchEvent ¶
func (store *Store) DispatchEvent()
func (*Store) GetColumnFamailyHandle ¶
func (store *Store) GetColumnFamailyHandle(name string) (*ColumnFamily, 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, cf *ColumnFamily, 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.