store

package
v0.0.0-...-8a55389 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Initialize sets up the storage layer
	Initialize() error
	// Exists returns true if a checkpoint with `uid` exists in the store, false otherwise
	Exists(uid string) (bool, error)
	// Save saves the checkpoint to the storage layer
	Save(c checkpoint.Checkpoint) error
	// Load loads the checkpoint with UID `uid` from the storage layer, or returns an error if the checkpoint does not exist
	Load(uid string) (checkpoint.Checkpoint, error)
	// CurrentModified returns the last time that the current UID was set
	CurrentModified() (time.Time, error)
	// Current returns the source that points to the current checkpoint, or nil if no current checkpoint is set
	Current() (checkpoint.RemoteConfigSource, error)
	// LastKnownGood returns the source that points to the last-known-good checkpoint, or nil if no last-known-good checkpoint is set
	LastKnownGood() (checkpoint.RemoteConfigSource, error)
	// SetCurrent saves the source that points to the current checkpoint, set to nil to unset
	SetCurrent(source checkpoint.RemoteConfigSource) error
	// SetCurrentUpdated is similar to SetCurrent, but also returns whether the current checkpoint changed as a result
	SetCurrentUpdated(source checkpoint.RemoteConfigSource) (bool, error)
	// SetLastKnownGood saves the source that points to the last-known-good checkpoint, set to nil to unset
	SetLastKnownGood(source checkpoint.RemoteConfigSource) error
	// Reset unsets the current and last-known-good UIDs and returns whether the current UID was unset as a result of the reset
	Reset() (bool, error)
}

Store saves checkpoints and information about which is the current and last-known-good checkpoint to a storage layer

func NewFsStore

func NewFsStore(fs utilfs.Filesystem, checkpointsDir string) Store

NewFsStore returns a Store that saves its data in `checkpointsDir`

Jump to

Keyboard shortcuts

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