statemanager

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentAction

type ComponentAction string
const (
	ActionCreate ComponentAction = "Create"
	ActionUpdate ComponentAction = "Update"
	ActionDelete ComponentAction = "Delete"
)

type Manager

type Manager interface {
	backend.Backend

	GetStatesMap() StatesMap

	GetState(key StateKey) *State
	AddState(key StateKey, state State) error
	UpdateState(key StateKey, state State) error
	DeleteState(key StateKey) error
	GetOutputs(key StateKey) (interface{}, error)
}

Manager knows how to manage the StatesMap.

func NewManager

func NewManager() (Manager, error)

type State

type State struct {
	Name     string
	Plugin   string
	Options  map[string]interface{}
	Resource map[string]interface{}
}

State is the single component's state.

type StateKey added in v0.3.0

type StateKey string

Note: Please use the StateKeyGenerateFunc function to generate StateKey instance.

func GenerateStateKeyByToolNameAndPluginKind added in v0.3.0

func GenerateStateKeyByToolNameAndPluginKind(toolName string, pluginKind string) StateKey

func StateKeyGenerateFunc added in v0.3.0

func StateKeyGenerateFunc(t *configloader.Tool) StateKey

type StatesMap

type StatesMap struct {
	*concurrentmap.ConcurrentMap
}

func NewStatesMap

func NewStatesMap() StatesMap

func (StatesMap) DeepCopy

func (s StatesMap) DeepCopy() StatesMap

func (StatesMap) Format

func (s StatesMap) Format() []byte

Jump to

Keyboard shortcuts

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