store

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package store

The memory store provides a store that can be used for testing and single-threaded applications. DO NOT USE this in a production application where persistence beyond a single application lifecycle is necessary or when there are multiple consumers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	sync.Map
}

Store is the in-memory data structure that holds the offsets per stream

func New

func New() *Store

New returns a new in memory store to persist the last consumed offset.

func (*Store) GetCheckpoint

func (c *Store) GetCheckpoint(streamName, shardID string) (string, error)

GetCheckpoint determines if a checkpoint for a particular Shard exists. Typically, this is used to determine whether processing should start with TRIM_HORIZON or AFTER_SEQUENCE_NUMBER (if checkpoint exists).

func (*Store) SetCheckpoint

func (c *Store) SetCheckpoint(streamName, shardID, sequenceNumber string) error

SetCheckpoint stores a checkpoint for a shard (e.g. sequence number of last record processed by application).

Jump to

Keyboard shortcuts

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