persistence

package
v0.0.0-...-3992780 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 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.ActorFunc) actor.ActorFunc

Types

type InMemoryProvider

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

func NewInMemoryProvider

func NewInMemoryProvider(snapshotInterval int) *InMemoryProvider

func (*InMemoryProvider) GetEvents

func (provider *InMemoryProvider) GetEvents(actorName string, eventIndexStart 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 {
	Restart()
	GetSnapshotInterval() int
	GetSnapshot(actorName string) (snapshot interface{}, eventIndex int, ok bool)
	GetEvents(actorName string, eventIndexStart int, callback func(e interface{}))
	PersistEvent(actorName string, eventIndex int, event proto.Message)
	PersistSnapshot(actorName string, eventIndex int, snapshot proto.Message)
}

type Replay

type Replay struct{}

type ReplayComplete

type ReplayComplete struct{}

type RequestSnapshot

type RequestSnapshot struct{}

Jump to

Keyboard shortcuts

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