eq_pipe_preserve

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorPreserveIsNotSupported = errors.New("this pipe does not support preserve")
)
View Source
var (
	ErrorSessionIsNotAvailable = errors.New("session is not available")
)

Functions

This section is empty.

Types

type Factory

type Factory interface {
	NewPreserver() Preserver

	NewRestorer(sessionId string) Restorer
}

func NewFactory

func NewFactory(l esl.Logger, basePath string) Factory

func NopFactory

func NopFactory() Factory

type Preserver

type Preserver interface {
	// Start preserve session
	Start() error

	// Add data to the preserver
	// Persistent store will be cleaned up when the operation failure.
	Add(d []byte) error

	// Commit data to the persistent store
	// Persistent store will be cleaned up when the operation failure.
	Commit(info []byte) (sessionId string, err error)
}

func NewPreserver

func NewPreserver(l esl.Logger, basePath string) Preserver

func NopPreserver

func NopPreserver() Preserver

type Restorer

type Restorer interface {
	// Restore
	Restore(infoLoader func(info []byte) error, loader func(d []byte) error) error
}

func NewRestorer

func NewRestorer(l esl.Logger, basePath, sessionId string) Restorer

func NopRestorer

func NopRestorer() Restorer

Jump to

Keyboard shortcuts

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