Documentation ¶
Index ¶
- type OffsetStore
- func (x *OffsetStore) Connect(context.Context) error
- func (x *OffsetStore) Disconnect(context.Context) error
- func (x *OffsetStore) GetCurrentOffset(_ context.Context, projectionID *egopb.ProjectionId) (current *egopb.Offset, err error)
- func (x *OffsetStore) Ping(ctx context.Context) error
- func (x *OffsetStore) ResetOffset(_ context.Context, projectionName string, value int64) error
- func (x *OffsetStore) WriteOffset(_ context.Context, offset *egopb.Offset) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OffsetStore ¶
type OffsetStore struct { // this is only useful for tests KeepRecordsAfterDisconnect bool // contains filtered or unexported fields }
OffsetStore implements the offset store interface NOTE: NOT RECOMMENDED FOR PRODUCTION CODE because all records are in memory and there is no durability. This is recommended for tests or PoC
func NewOffsetStore ¶
func NewOffsetStore() *OffsetStore
NewOffsetStore creates an instance of OffsetStore
func (*OffsetStore) Connect ¶
func (x *OffsetStore) Connect(context.Context) error
Connect connects to the offset store
func (*OffsetStore) Disconnect ¶
func (x *OffsetStore) Disconnect(context.Context) error
Disconnect disconnects the offset store
func (*OffsetStore) GetCurrentOffset ¶
func (x *OffsetStore) GetCurrentOffset(_ context.Context, projectionID *egopb.ProjectionId) (current *egopb.Offset, err error)
GetCurrentOffset return the offset of a projection
func (*OffsetStore) Ping ¶
func (x *OffsetStore) Ping(ctx context.Context) error
Ping verifies a connection to the database is still alive, establishing a connection if necessary.
func (*OffsetStore) ResetOffset ¶
ResetOffset resets the offset of given projection to a given value across all shards
func (*OffsetStore) WriteOffset ¶
WriteOffset writes an offset to the offset store
Click to show internal directories.
Click to hide internal directories.