state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Factory

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

Factory is the method to initialize the state

type State

type State interface {
	Apply(*proto.Component) (int64, error)

	// GetComponent(id string) (*proto.Component, error)
	GetComponent(namespace, id string, sequence int64) (*proto.Component, error)
	GetComponentByID(namespace, name string, compID string) (*proto.Component, error)

	Finalize(id string) error
	GetPending(id string) (*proto.Component, error)
	GetTask(ctx context.Context) *proto.Component
	GetTask2(ctx context.Context) *proto.Task

	ListDeployments() ([]*proto.Deployment, error)
	UpdateDeployment(d *proto.Deployment) error
	UpsertNode(n *proto.Instance) error
	LoadDeployment(id string) (*proto.Deployment, error)
	LoadInstance(cluster, id string) (*proto.Instance, 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