state

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClusterNotFound = fmt.Errorf("cluster not found")
)

Functions

func TestSuite

func TestSuite(t *testing.T, setup setupFn)

TestSuite has a suite of tests for state implementations

Types

type Factory

type Factory func(map[string]interface{}) (State, error)

Factory is the method to initialize the state

type State

type State interface {
	// UpsertNode updates the node
	UpsertNode(*proto.Node) error

	// UpsertCluster upserts the cluster
	UpsertCluster(*proto.Cluster) error

	// Apply changes to a resource
	Apply(*proto.Component) error

	// Get returns a component
	Get(name string) (*proto.Component, error)

	// GetTask returns a new task to apply
	GetTask(ctx context.Context) (*proto.ComponentTask, error)

	// LoadCluster loads a cluster from memory
	LoadCluster(id string) (*proto.Cluster, error)

	// Finalize notifies when a component has been reconciled
	Finalize(id string) error

	// Close closes the state
	Close() error
}

State stores the state of the Ensemble server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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