memory

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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(ctx context.Context) error

Connect connects to the offset store

func (*OffsetStore) Disconnect

func (x *OffsetStore) Disconnect(ctx context.Context) error

Disconnect disconnects the offset store

func (*OffsetStore) GetCurrentOffset

func (x *OffsetStore) GetCurrentOffset(ctx 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

func (x *OffsetStore) ResetOffset(ctx context.Context, projectionName string, value int64) error

ResetOffset resets the offset of given projection to a given value across all shards

func (*OffsetStore) WriteOffset

func (x *OffsetStore) WriteOffset(ctx context.Context, offset *egopb.Offset) error

WriteOffset writes an offset to the offset store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL