persistence

package
v0.0.0-...-be9e185 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boltdb

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

Boltdb struct provider

func NewBoltdbProvider

func NewBoltdbProvider(path string, snapshotInterval int, eventFunc ParseMessage, snapFunc ParseMessage) (*Boltdb, error)

NewBoltdbProvider create a provider for multiples actors. Only one instance is support in runtime

func (*Boltdb) DeleteEvents

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

func (*Boltdb) DeleteSnapshots

func (db *Boltdb) DeleteSnapshots(actorName string, inclusiveToIndex int)

func (*Boltdb) GetEvents

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

GetEvents get events for actor from eventIndexStart

func (*Boltdb) GetSnapshot

func (provider *Boltdb) GetSnapshot(actorName string) (interface{}, int, bool)

GetSnapshot get last snapshot in provider for actor

func (*Boltdb) GetSnapshotInterval

func (provider *Boltdb) GetSnapshotInterval() int

GetSnapshotInterval get snapshot interval in provider

func (*Boltdb) PersistEvent

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

PersistEvent persiste event

func (*Boltdb) PersistSnapshot

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

PersistSnapshot save snapshot, the snapshot is overwrite

func (*Boltdb) Restart

func (provider *Boltdb) Restart()

Restart provider

type ParseMessage

type ParseMessage func(src []byte) proto.Message

Jump to

Keyboard shortcuts

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