offsetstore

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetStore

type OffsetStore interface {
	// Connect connects to the offset store
	Connect(ctx context.Context) error
	// Disconnect disconnects the offset store
	Disconnect(ctx context.Context) error
	// Ping verifies a connection to the database is still alive, establishing a connection if necessary.
	Ping(ctx context.Context) error
	// WriteOffset writes the current offset of the event consumed for a given projection id
	// Note: persistence id and the projection name make a record in the journal store unique. Failure to ensure that
	// can lead to some un-wanted behaviors and data inconsistency
	WriteOffset(ctx context.Context, offset *egopb.Offset) error
	// GetCurrentOffset returns the current offset of a given projection id
	GetCurrentOffset(ctx context.Context, projectionID *egopb.ProjectionId) (currentOffset *egopb.Offset, err error)
	// ResetOffset resets the offset of given projection to a given value across all shards
	ResetOffset(ctx context.Context, projectionName string, value int64) error
}

OffsetStore defines the contract needed to persist offsets

Jump to

Keyboard shortcuts

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