persister

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File is an implementation of Persister that keeps track of all state on local disk.

func NewFile

func NewFile(dir string) *File

NewFile creates a new instance of File. The dir parameter must be writable by the current process.

func (File) LoadState

func (p File) LoadState(ctx context.Context, readerID types.ReaderID) (types.State, error)

LoadState implements Persister.

func (File) SaveState

func (p File) SaveState(ctx context.Context, readerID types.ReaderID, state types.State) error

SaveState implements Persister.

type Noop

type Noop struct{}

Noop is a stupid implementation of Persister which does nothing. It can be used for testing so that the daemon always reads something.

func NewNoop

func NewNoop() Noop

NewNoop creates a new intance of Noop.

func (Noop) LoadState

func (n Noop) LoadState(ctx context.Context, readerID types.ReaderID) (types.State, error)

LoadState implements Persister.

func (Noop) SaveState

func (n Noop) SaveState(ctx context.Context, readerID types.ReaderID, state types.State) error

SaveState implements Persister.

Jump to

Keyboard shortcuts

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