Documentation ¶
Overview ¶
Package environment defines Environment, environment.Manager and other types and methods related to handling O² environments.
Index ¶
- func JSONSliceToSlice(payload string) (slice []string, err error)
- func SliceToJSONSlice(slice []string) (payload string, err error)
- type ConfigureTransition
- type DeployTransition
- type Environment
- func (env *Environment) CreatedWhen() time.Time
- func (env *Environment) CurrentState() string
- func (env *Environment) CurrentTransition() string
- func (env *Environment) GetActiveDetectors() (response system.IDMap)
- func (env *Environment) GetAllHosts() []string
- func (env *Environment) GetCurrentRunNumber() (rn uint32)
- func (env *Environment) GetFLPs() []string
- func (env *Environment) GetKV(path, key string) string
- func (env *Environment) GetPath() string
- func (env *Environment) GetRunType() runtype.RunType
- func (env *Environment) GetVarsAsString() string
- func (env *Environment) Id() uid.ID
- func (env *Environment) IsSafeToStop() bool
- func (env *Environment) NotifyEvent(e event.DeviceEvent)
- func (env *Environment) QueryRoles(pathSpec string) (rs []workflow.Role)
- func (env *Environment) TryTransition(t Transition) (err error)
- func (env *Environment) Workflow() workflow.Role
- type GoErrorTransition
- type Manager
- func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[string]string, newId uid.ID, ...)
- func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string]string, public bool, newId uid.ID) (uid.ID, error)
- func (envs *Manager) Environment(environmentId uid.ID) (env *Environment, err error)
- func (envs *Manager) GetActiveDetectors() system.IDMap
- func (envs *Manager) Ids() (keys []uid.ID)
- func (envs *Manager) NotifyIntegratedServiceEvent(event event.IntegratedServiceEvent)
- func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error
- type ResetTransition
- type StartActivityTransition
- type StopActivityTransition
- type Subscription
- type Transition
- func MakeTransition(taskman *task.Manager, optype pb.ControlEnvironmentRequest_Optype) Transition
- func NewConfigureTransition(taskman *task.Manager) Transition
- func NewDeployTransition(taskman *task.Manager, addRoles []string, removeRoles []string) Transition
- func NewGoErrorTransition(taskman *task.Manager) Transition
- func NewResetTransition(taskman *task.Manager) Transition
- func NewStartActivityTransition(taskman *task.Manager) Transition
- func NewStopActivityTransition(taskman *task.Manager) Transition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONSliceToSlice ¶ added in v0.26.3
func SliceToJSONSlice ¶ added in v0.26.3
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 (*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 (*Manager) Environment ¶
func (envs *Manager) Environment(environmentId uid.ID) (env *Environment, err error)
func (*Manager) GetActiveDetectors ¶ added in v0.26.3
func (*Manager) NotifyIntegratedServiceEvent ¶ added in v0.75.0
func (envs *Manager) NotifyIntegratedServiceEvent(event event.IntegratedServiceEvent)
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
Click to show internal directories.
Click to hide internal directories.