memory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventsAfter

func GetEventsAfter(events []storage.EventRecord, last uuid.UUID) []storage.EventRecord

func InMemoryStorage

func InMemoryStorage() storage.Storage

Types

type IdLinks map[string]map[uuid.UUID]storage.AggregatedIds

type InMemoryCommandStore

type InMemoryCommandStore struct {
	Commands map[uuid.UUID][]storage.CommandRecord
}

func (*InMemoryCommandStore) Add

func (store *InMemoryCommandStore) Add(
	ctx context.Context,
	actorName string,
	command storage.CommandRecord) error

type InMemoryEventStore

type InMemoryEventStore struct {
	Events map[uuid.UUID][]storage.EventRecord
}

func (*InMemoryEventStore) Add

func (store *InMemoryEventStore) Add(ctx context.Context, events []storage.EventRecord) error

func (*InMemoryEventStore) FetchAggregatedSince

func (store *InMemoryEventStore) FetchAggregatedSince(
	ctx context.Context,
	actorName string,
	actorId uuid.UUID,
	eventUUID uuid.UUID,
	idMap storage.LastEventMap,
	types storage.TypeMap) ([]storage.EventRecord, error)

func (*InMemoryEventStore) FetchSince

func (store *InMemoryEventStore) FetchSince(
	ctx context.Context,
	actorName string,
	actorId uuid.UUID,
	eventUUID uuid.UUID,
	types storage.TypeMap) ([]storage.EventRecord, error)

type InMemoryMapStore

type InMemoryMapStore struct {
	IdMap   map[string]uuid.UUID
	LinkMap IdLinks
}

func (*InMemoryMapStore) AddId

func (maps *InMemoryMapStore) AddId(ctx context.Context, actorName string, ids spry.Identifiers, uid uuid.UUID) error
func (maps *InMemoryMapStore) AddLink(ctx context.Context, parentType string, parentId uuid.UUID, childType string, childId uuid.UUID) error

func (*InMemoryMapStore) GetId

func (maps *InMemoryMapStore) GetId(ctx context.Context, actorName string, ids spry.Identifiers) (uuid.UUID, error)

func (*InMemoryMapStore) GetIdMap

func (maps *InMemoryMapStore) GetIdMap(
	ctx context.Context,
	actorName string,
	uid uuid.UUID) (storage.AggregateIdMap, error)

type InMemorySnapshotStore

type InMemorySnapshotStore struct {
	Snapshots map[uuid.UUID][]storage.Snapshot
}

func (*InMemorySnapshotStore) Add

func (store *InMemorySnapshotStore) Add(ctx context.Context, actorName string, snapshot storage.Snapshot, allowPartition bool) error

func (*InMemorySnapshotStore) Fetch

func (store *InMemorySnapshotStore) Fetch(ctx context.Context, actorName string, actorId uuid.UUID) (storage.Snapshot, error)

type InMemoryTxProvider

type InMemoryTxProvider struct {
}

func (InMemoryTxProvider) Commit

func (provider InMemoryTxProvider) Commit(ctx context.Context) error

func (InMemoryTxProvider) GetTransaction

func (provider InMemoryTxProvider) GetTransaction(ctx context.Context) (storage.NoOpTx, error)

func (InMemoryTxProvider) Rollback

func (provider InMemoryTxProvider) Rollback(ctx context.Context) error

Jump to

Keyboard shortcuts

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