store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package store provides state to the apate cluster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ConnectionInfo service.ConnectionInfo
	UUID           uuid.UUID
	Status         health.Status
	Label          string
	Resources      *scenario.NodeResources
}

Node represents a Apatelet in the Apate cluster

func NewNode

func NewNode(info service.ConnectionInfo, resources *scenario.NodeResources, label string) *Node

NewNode creates a new Node based on the given connection information

type Store

type Store interface {
	// AddNode adds the given Node to the Apate cluster
	AddNode(*Node) error

	// RemoveNode removes the given Node from the Apate cluster by uuid
	RemoveNode(uuid.UUID) error

	// RemoveNodes removes the given Nodes from the Apate cluster by uuids
	RemoveNodes([]uuid.UUID) error

	// GetNode returns the node with the given uuid
	GetNode(uuid.UUID) (Node, error)

	// SetNodeStatus sets the status of the node with the given uuid
	SetNodeStatus(uuid.UUID, health.Status) error

	// GetNodes returns an array containing all nodes in the Apate cluster
	GetNodes() ([]Node, error)

	// GetNodesByLabel returns an array containing all nodes in the Apate cluster with the given label
	GetNodesByLabel(string) ([]Node, error)

	// ClearNodes removes all nodes from the Apate cluster
	ClearNodes() error

	// AddResourcesToQueue adds a node resource to the queue
	AddResourcesToQueue([]scenario.NodeResources) error

	// GetResourceFromQueue returns the first NodeResources struct in the list
	GetResourceFromQueue() (*scenario.NodeResources, error)

	// SetApateletScenario adds the ApateletScenario to the store
	SetApateletScenario(*apatelet.ApateletScenario) error

	// GetApateletScenario gets the ApateletScenario
	GetApateletScenario() (*apatelet.ApateletScenario, error)
}

Store represents the store of the control plane

func NewStore

func NewStore() Store

NewStore creates a new empty cluster

Directories

Path Synopsis
Package mock_store is a generated GoMock package.
Package mock_store is a generated GoMock package.

Jump to

Keyboard shortcuts

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