checkstore

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MPL-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shim

type Shim interface {
	// Set the latest result for a specific check.
	Set(allocID string, result *structs.CheckQueryResult) error

	// List the latest results for a specific allocation.
	List(allocID string) map[structs.CheckID]*structs.CheckQueryResult

	// Difference returns the set of IDs being stored that are not in ids.
	Difference(allocID string, ids []structs.CheckID) []structs.CheckID

	// Remove will remove ids from the cache and persistent store.
	Remove(allocID string, ids []structs.CheckID) error

	// Purge results for a specific allocation.
	Purge(allocID string) error

	// Snapshot returns a copy of the current status of every check indexed by
	// checkID, for use by CheckWatcher.
	Snapshot() map[string]string
}

A Shim is used to track the latest check status information, one layer above the client persistent store so we can do efficient indexing, etc.

func NewStore

func NewStore(log hclog.Logger, db state.StateDB) Shim

NewStore creates a new store.

Jump to

Keyboard shortcuts

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