environment

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-3.0 Imports: 40 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package environment defines Environment, environment.Manager and other types and methods related to handling O² environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSliceToSlice added in v0.26.3

func JSONSliceToSlice(payload string) (slice []string, err error)

func SliceToJSONSlice added in v0.26.3

func SliceToJSONSlice(slice []string) (payload string, err error)

Types

type ConfigureTransition

type ConfigureTransition struct {
	// contains filtered or unexported fields
}

type DeployTransition added in v0.24.80

type DeployTransition struct {
	// contains filtered or unexported fields
}

type Environment

type Environment struct {
	Mu sync.RWMutex

	Sm *fsm.FSM

	GlobalDefaults  gera.StringMap    // From Consul
	GlobalVars      gera.StringMap    // From Consul
	UserVars        gera.StringMap    // From user input
	BaseConfigStack map[string]string // Exclusively from Consul, already flattened for performance

	Public      bool   // From workflow or user
	Description string // From workflow
	// contains filtered or unexported fields
}

func (*Environment) CreatedWhen

func (env *Environment) CreatedWhen() time.Time

func (*Environment) CurrentState

func (env *Environment) CurrentState() string

func (*Environment) CurrentTransition added in v0.74.0

func (env *Environment) CurrentTransition() string

func (*Environment) GetActiveDetectors added in v0.26.3

func (env *Environment) GetActiveDetectors() (response system.IDMap)

func (*Environment) GetAllHosts added in v0.48.0

func (env *Environment) GetAllHosts() []string

func (*Environment) GetCurrentRunNumber added in v0.8.0

func (env *Environment) GetCurrentRunNumber() (rn uint32)

func (*Environment) GetFLPs added in v0.20.80

func (env *Environment) GetFLPs() []string

func (*Environment) GetKV added in v0.26.3

func (env *Environment) GetKV(path, key string) string

func (*Environment) GetPath

func (env *Environment) GetPath() string

func (*Environment) GetRunType added in v0.22.81

func (env *Environment) GetRunType() runtype.RunType

func (*Environment) GetVarsAsString added in v0.26.7

func (env *Environment) GetVarsAsString() string

func (*Environment) Id

func (env *Environment) Id() uid.ID

func (*Environment) IsSafeToStop added in v0.12.0

func (env *Environment) IsSafeToStop() bool

func (*Environment) NotifyEvent added in v0.16.0

func (env *Environment) NotifyEvent(e event.DeviceEvent)

func (*Environment) QueryRoles

func (env *Environment) QueryRoles(pathSpec string) (rs []workflow.Role)

func (*Environment) TryTransition

func (env *Environment) TryTransition(t Transition) (err error)

func (*Environment) Workflow

func (env *Environment) Workflow() workflow.Role

type GoErrorTransition added in v0.38.80

type GoErrorTransition struct {
	// contains filtered or unexported fields
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func ManagerInstance added in v0.27.0

func ManagerInstance() *Manager

func NewEnvManager

func NewEnvManager(tm *task.Manager, incomingEventCh chan event.Event) *Manager

func (*Manager) CreateAutoEnvironment added in v0.19.80

func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[string]string, newId uid.ID, sub Subscription)

FIXME: this function should be deduplicated with CreateEnvironment so detector resource matching works correctly

func (*Manager) CreateEnvironment

func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string]string, public bool, newId uid.ID) (uid.ID, error)

func (*Manager) Environment

func (envs *Manager) Environment(environmentId uid.ID) (env *Environment, err error)

func (*Manager) GetActiveDetectors added in v0.26.3

func (envs *Manager) GetActiveDetectors() system.IDMap

func (*Manager) Ids

func (envs *Manager) Ids() (keys []uid.ID)

func (*Manager) NotifyIntegratedServiceEvent added in v0.75.0

func (envs *Manager) NotifyIntegratedServiceEvent(event event.IntegratedServiceEvent)

func (*Manager) TeardownEnvironment

func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error

type ResetTransition

type ResetTransition struct {
	// contains filtered or unexported fields
}

type StartActivityTransition

type StartActivityTransition struct {
	// contains filtered or unexported fields
}

type StopActivityTransition

type StopActivityTransition struct {
	// contains filtered or unexported fields
}

type Subscription added in v0.19.80

type Subscription interface {
	Unsubscribe()
	GetFeed() chan *pb.Event
	Send(event.Event)
	Err() <-chan error
}

func SubscribeToStream added in v0.19.80

func SubscribeToStream(ch chan *pb.Event) Subscription

type Transition

type Transition interface {
	// contains filtered or unexported methods
}

func MakeTransition

func MakeTransition(taskman *task.Manager, optype pb.ControlEnvironmentRequest_Optype) Transition

func NewConfigureTransition

func NewConfigureTransition(taskman *task.Manager) Transition

func NewDeployTransition added in v0.24.80

func NewDeployTransition(taskman *task.Manager, addRoles []string, removeRoles []string) Transition

func NewGoErrorTransition added in v0.38.80

func NewGoErrorTransition(taskman *task.Manager) Transition

func NewResetTransition

func NewResetTransition(taskman *task.Manager) Transition

func NewStartActivityTransition

func NewStartActivityTransition(taskman *task.Manager) Transition

func NewStopActivityTransition

func NewStopActivityTransition(taskman *task.Manager) Transition

Jump to

Keyboard shortcuts

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