persistence

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PartitionID = "aws"
	EndpointURL = "http://localhost:4566"
)

Variables

View Source
var File_protos_proto protoreflect.FileDescriptor

Functions

func InitializeDynamoDBClient

func InitializeDynamoDBClient() *dynamodb.Client

Types

type Event

type Event struct {
	Id         string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type       string                 `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Data       string                 `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	OccurredAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetData

func (x *Event) GetData() string

func (*Event) GetId added in v0.1.2

func (x *Event) GetId() string

func (*Event) GetOccurredAt added in v0.1.3

func (x *Event) GetOccurredAt() *timestamppb.Timestamp

func (*Event) GetType added in v0.1.2

func (x *Event) GetType() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventStore

type EventStore struct {
	// contains filtered or unexported fields
}

func NewEventStore

func NewEventStore(client *dynamodb.Client, table string) *EventStore

func (*EventStore) DeleteEvents

func (e *EventStore) DeleteEvents(actorName string, inclusiveToIndex int)

func (*EventStore) GetEvents

func (e *EventStore) GetEvents(actorName string, eventIndexStart int, eventIndexEnd int, callback func(e interface{}))

func (*EventStore) PersistEvent

func (e *EventStore) PersistEvent(actorName string, eventIndex int, event protoreflect.ProtoMessage)

type ProviderState

type ProviderState struct {
	// contains filtered or unexported fields
}

ProviderState is an object containing the implementation for the provider

func NewProviderState

func NewProviderState(client *dynamodb.Client) *ProviderState

NewProviderState creates a new instance of ProviderState

func (*ProviderState) DeleteEvents

func (p *ProviderState) DeleteEvents(actorName string, inclusiveToIndex int)

func (*ProviderState) DeleteSnapshots

func (p *ProviderState) DeleteSnapshots(actorName string, inclusiveToIndex int)

func (*ProviderState) GetEvents

func (p *ProviderState) GetEvents(actorName string, eventIndexStart int, eventIndexEnd int, callback func(e interface{}))

func (*ProviderState) GetSnapshot

func (p *ProviderState) GetSnapshot(actorName string) (snapshot interface{}, eventIndex int, ok bool)

func (*ProviderState) GetSnapshotInterval

func (p *ProviderState) GetSnapshotInterval() int

GetSnapshotInterval returns the snapshot interval

func (*ProviderState) GetState

func (p *ProviderState) GetState() persistence.ProviderState

GetState returns the current state of the provider

func (*ProviderState) PersistEvent

func (p *ProviderState) PersistEvent(actorName string, eventIndex int, event protoreflect.ProtoMessage)

func (*ProviderState) PersistSnapshot

func (p *ProviderState) PersistSnapshot(actorName string, snapshotIndex int, snapshot protoreflect.ProtoMessage)

func (*ProviderState) Restart

func (p *ProviderState) Restart()

Restart restarts the provider

type Snapshot

type Snapshot struct {
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Snapshot) Descriptor deprecated

func (*Snapshot) Descriptor() ([]byte, []int)

Deprecated: Use Snapshot.ProtoReflect.Descriptor instead.

func (*Snapshot) GetData

func (x *Snapshot) GetData() string

func (*Snapshot) GetType added in v0.1.2

func (x *Snapshot) GetType() string

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) ProtoReflect

func (x *Snapshot) ProtoReflect() protoreflect.Message

func (*Snapshot) Reset

func (x *Snapshot) Reset()

func (*Snapshot) String

func (x *Snapshot) String() string

type SnapshotStore

type SnapshotStore struct {
	// contains filtered or unexported fields
}

func NewSnapshotStore

func NewSnapshotStore(client *dynamodb.Client, table string) *SnapshotStore

func (*SnapshotStore) DeleteSnapshots

func (s *SnapshotStore) DeleteSnapshots(actorName string, inclusiveToIndex int)

func (*SnapshotStore) GetSnapshot

func (s *SnapshotStore) GetSnapshot(actorName string) (snapshot interface{}, eventIndex int, ok bool)

func (*SnapshotStore) PersistSnapshot

func (s *SnapshotStore) PersistSnapshot(actorName string, eventIndex int, snapshot protoreflect.ProtoMessage)

Jump to

Keyboard shortcuts

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