pkg

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PositionStart = 0
	PositionEnd   = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDbEventStore

type DynamoDbEventStore struct {
	Db         dynamodbiface.DynamoDBAPI
	EventTable string
	// contains filtered or unexported fields
}

func NewEventStore

func NewEventStore(dynamodb dynamodbiface.DynamoDBAPI, table string) *DynamoDbEventStore

NewEventStore return a DynamoDbEventStore

func (*DynamoDbEventStore) AllowDuplicateCommitPosition

func (es *DynamoDbEventStore) AllowDuplicateCommitPosition()

func (*DynamoDbEventStore) DisableConsistentReads

func (es *DynamoDbEventStore) DisableConsistentReads()

func (*DynamoDbEventStore) ReadAllEventsBackward

func (es *DynamoDbEventStore) ReadAllEventsBackward(position int64, count int64) ([]Event, error)

ReadAllEventsBackward reads from events across all streams starting at specified index and reads backward by the count Query is inclusive of start position

func (*DynamoDbEventStore) ReadAllEventsForward

func (es *DynamoDbEventStore) ReadAllEventsForward(position int64, count int64) ([]Event, error)

ReadAllEventsForward reads from events across all streams starting at specified index and reads forward by the count Query is inclusive of start position

func (*DynamoDbEventStore) ReadStreamEventsBackward

func (es *DynamoDbEventStore) ReadStreamEventsBackward(streamId string, start int64, count int64) ([]Event, error)

ReadStreamEventsBackward reads from the specified stream id starting at specified index and reads backward by the count Query is inclusive of start position

func (*DynamoDbEventStore) ReadStreamEventsForward

func (es *DynamoDbEventStore) ReadStreamEventsForward(streamId string, start int64, count int64) ([]Event, error)

ReadStreamEventsForward reads from the specified stream id starting at specified index and reads forward by the count Query is inclusive of start position

func (*DynamoDbEventStore) Save

func (es *DynamoDbEventStore) Save(streamId string, expectedVersion int, eventType string, event []byte) error

Save a new event to a specified stream. Returns the global position of the message.

type Event

type Event struct {
	StreamId        string `dynamodbav:"streamId"`
	Version         int    `dynamodbav:"version"`
	CommittedAt     int64  `dynamodbav:"committedAt"`
	MessagePosition int64  `dynamodbav:"position"`
	Type            string `dynamodbav:"type"`
	Data            []byte `dynamodbav:"eventData"`
}

Jump to

Keyboard shortcuts

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