checkpoint

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleCheckpointManager

func NewSimpleCheckpointManager(path string) *simpleCheckpointManager

Provides checkpoint manager that uses key to store checkpoints within provided directory. The manager uses std json package to encode/decode the stucts. This is thread-safe per key which is usual usage.

Types

type CheckpointManager

type CheckpointManager interface {
	// Retrieves checkpoint for given key. The value needs to be pointer to struct.
	// os.ErrNotExist is returned if there is no checkpoint for given key.
	Get(key string, value interface{}) error
	// Stores checkpoint for given key. The value needs to be pointer to struct.
	Store(key string, value interface{}) error
	// os.ErrNotExist is returned if there is no checkpoint for given key.
	Delete(key string) error
}

Warning: The interface doesn't require thread-safe behaviour

Jump to

Keyboard shortcuts

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