persistence

package
v0.0.0-...-be88ffe Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Using

func Using(provider Provider) func(next actor.ReceiverFunc) actor.ReceiverFunc

Types

type EventStore

type EventStore interface {
	GetEvents(actorName string, eventIndexStart int, eventIndexEnd int, callback func(e interface{}))
	PersistEvent(actorName string, eventIndex int, event proto.Message)
	DeleteEvents(actorName string, inclusiveToIndex int)
}

type InMemoryProvider

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

func NewInMemoryProvider

func NewInMemoryProvider(snapshotInterval int) *InMemoryProvider

func (*InMemoryProvider) DeleteEvents

func (provider *InMemoryProvider) DeleteEvents(actorName string, inclusiveToIndex int)

func (*InMemoryProvider) DeleteSnapshots

func (provider *InMemoryProvider) DeleteSnapshots(actorName string, inclusiveToIndex int)

func (*InMemoryProvider) GetEvents

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

func (*InMemoryProvider) GetSnapshot

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

func (*InMemoryProvider) GetSnapshotInterval

func (provider *InMemoryProvider) GetSnapshotInterval() int

func (*InMemoryProvider) PersistEvent

func (provider *InMemoryProvider) PersistEvent(actorName string, eventIndex int, event proto.Message)

func (*InMemoryProvider) PersistSnapshot

func (provider *InMemoryProvider) PersistSnapshot(actorName string, eventIndex int, snapshot proto.Message)

func (*InMemoryProvider) Restart

func (provider *InMemoryProvider) Restart()

type Mixin

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

func (*Mixin) Name

func (mixin *Mixin) Name() string

func (*Mixin) PersistReceive

func (mixin *Mixin) PersistReceive(message proto.Message)

func (*Mixin) PersistSnapshot

func (mixin *Mixin) PersistSnapshot(snapshot proto.Message)

func (*Mixin) Recovering

func (mixin *Mixin) Recovering() bool

type OfferSnapshot

type OfferSnapshot struct {
	Snapshot interface{}
}

type Provider

type Provider interface {
	GetState() ProviderState
}

Provider is the abstraction used for persistence

type ProviderState

type ProviderState interface {
	SnapshotStore
	EventStore

	Restart()
	GetSnapshotInterval() int
}

ProviderState is an object containing the implementation for the provider

type Replay

type Replay struct{}

type ReplayComplete

type ReplayComplete struct{}

type RequestSnapshot

type RequestSnapshot struct{}

type SnapshotStore

type SnapshotStore interface {
	GetSnapshot(actorName string) (snapshot interface{}, eventIndex int, ok bool)
	PersistSnapshot(actorName string, snapshotIndex int, snapshot proto.Message)
	DeleteSnapshots(actorName string, inclusiveToIndex int)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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