Documentation
¶
Index ¶
- Variables
- func GetYoungestElement[T any](list []T, elementTimeProvider func(T) (time.Time, error)) (result T, err error)
- type Config
- type Controller
- type DbInterface
- type DeploymentWardenInfo
- type GenericWarden
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddDeploymentWarden(info DeploymentWardenInfo) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddInstanceWarden(info WardenInfo) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckDeploymentWardenInfo(info DeploymentWardenInfo) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckProcessInstance(instance ProcessInstance) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckWardenInfo(info WardenInfo) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) InstanceIsCreatedWithWardenHandlingIntended(instance ProcessInstance) bool
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopDeploymentWardenDb() error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopProcesses() error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopWardenDb() error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) MarkInstanceBusinessKeyAsWardenHandled(businessKey string) string
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeployment(deploymentId string) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeploymentWardenById(networkId string, deploymentId string) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWarden(info WardenInfo) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWardenByBusinessKey(networkId string, businessKey string) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveWardenInfoByInstance(instance ProcessInstance) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) Start(ctx context.Context) error
- func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) UpdateWardenInfoDeploymentId(networkId string, oldDeploymentId string, newDeploymentId string) error
- type Processes
- func (this *Processes) AllInstances() iter.Seq2[model.ProcessInstance, error]
- func (this *Processes) DeploymentExistsForDeploymentWarden(info DeploymentWardenInfo) (exist bool, err error)
- func (this *Processes) DeploymentExistsForWarden(info WardenInfo) (exist bool, err error)
- func (this *Processes) GetIncidents(history model.HistoricProcessInstance) ([]model.Incident, error)
- func (this *Processes) GetInstanceHistories(info WardenInfo) ([]model.HistoricProcessInstance, error)
- func (this *Processes) GetInstances(info WardenInfo) ([]model.ProcessInstance, error)
- func (this *Processes) GetYoungestHistory(histories []model.HistoricProcessInstance) (model.HistoricProcessInstance, error)
- func (this *Processes) GetYoungestIncident(incidents []model.Incident) (model.Incident, error)
- func (this *Processes) GetYoungestProcessInstance(instances []model.ProcessInstance) (model.ProcessInstance, error)
- func (this *Processes) HistoryIsOlderThen(history model.HistoricProcessInstance, duration time.Duration) (bool, error)
- func (this *Processes) IncidentIsOlderThen(incident model.Incident, duration time.Duration) bool
- func (this *Processes) InstanceIsCreatedWithWardenHandlingIntended(instance model.ProcessInstance) bool
- func (this *Processes) InstanceIsOldPlaceholder(instance model.ProcessInstance) (bool, error)
- func (this *Processes) InstanceIsOlderThen(instance model.ProcessInstance, duration time.Duration) (bool, error)
- func (this *Processes) MarkInstanceBusinessKeyAsWardenHandled(businessKey string) string
- func (this *Processes) Redeploy(info DeploymentWardenInfo) error
- func (this *Processes) Start(info WardenInfo) (err error)
- func (this *Processes) Stop(instance model.ProcessInstance) (err error)
- type ProcessesInterface
- type Warden
- type WardenDb
- func (this *WardenDb) GetDeploymentWardenInfo(info WardenInfo) (result DeploymentWardenInfo, exists bool, err error)
- func (this *WardenDb) GetWardenInfoForDeploymentId(deploymentId string) ([]WardenInfo, error)
- func (this *WardenDb) GetWardenInfoForInstance(instance model.ProcessInstance) ([]WardenInfo, error)
- func (this *WardenDb) ListDeploymentWardenInfo() iter.Seq2[DeploymentWardenInfo, error]
- func (this *WardenDb) ListWardenInfo() iter.Seq2[WardenInfo, error]
- func (this *WardenDb) RemoveDeploymentWardenById(networkId string, deploymentId string) error
- func (this *WardenDb) RemoveWardenInfo(info WardenInfo) error
- func (this *WardenDb) RemoveWardenInfoByBusinessKey(networkId string, businessKey string) error
- func (this *WardenDb) SetDeploymentWardenInfo(info model.DeploymentWardenInfo) error
- func (this *WardenDb) SetWardenInfo(info WardenInfo) error
- func (this *WardenDb) UpdateWardenInfoDeploymentId(networkId string, oldDeploymentId string, newDeploymentId string) error
- type WardenInfo
- type WardenInfoInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFinal = fmt.Errorf("will not be retried")
View Source
var ErrRetry = fmt.Errorf("will be retried")
Functions ¶
Types ¶
type Controller ¶
type Controller interface {
StartDeploymentWithoutWardenHandling(networkId, processDeploymentId, businessKey string, startParameters map[string]interface{}) (err error, errCode int)
StopProcessInstanceWithoutWardenHandling(instance model.ProcessInstance) (err error, errCode int)
DeployProcessWithoutWardenHandling(networkId string, deployment model.DeploymentWithEventDesc) (err error)
}
type DbInterface ¶
type DbInterface[WardenInfo WardenInfoInterface, DeploymentWardenInfo any, ProcessInstance any] interface { ListWardenInfo() iter.Seq2[WardenInfo, error] GetWardenInfoForInstance(ProcessInstance) ([]WardenInfo, error) GetWardenInfoForDeploymentId(deploymentId string) ([]WardenInfo, error) GetDeploymentWardenInfo(WardenInfo) (result DeploymentWardenInfo, exist bool, err error) SetWardenInfo(WardenInfo) error RemoveWardenInfo(WardenInfo) error SetDeploymentWardenInfo(info DeploymentWardenInfo) error RemoveDeploymentWardenById(networkId string, deploymentId string) error RemoveWardenInfoByBusinessKey(networkId string, businessKey string) error ListDeploymentWardenInfo() iter.Seq2[DeploymentWardenInfo, error] UpdateWardenInfoDeploymentId(networkId string, oldDeploymentId string, newDeploymentId string) error }
type DeploymentWardenInfo ¶
type DeploymentWardenInfo = model.DeploymentWardenInfo
type GenericWarden ¶
type GenericWarden[WardenInfo WardenInfoInterface, DeploymentWardenInfo any, ProcessInstance any, History any, Incident any] struct { // contains filtered or unexported fields }
func NewGeneric ¶
func NewGeneric[WardenInfo WardenInfoInterface, DeploymentWardenInfo any, ProcessInstance any, History any, Incident any](config Config, processes ProcessesInterface[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident], db DbInterface[WardenInfo, DeploymentWardenInfo, ProcessInstance]) *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddDeploymentWarden ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddDeploymentWarden(info DeploymentWardenInfo) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddInstanceWarden ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) AddInstanceWarden(info WardenInfo) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckDeploymentWardenInfo ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckDeploymentWardenInfo(info DeploymentWardenInfo) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckProcessInstance ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckProcessInstance(instance ProcessInstance) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckWardenInfo ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) CheckWardenInfo(info WardenInfo) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) InstanceIsCreatedWithWardenHandlingIntended ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) InstanceIsCreatedWithWardenHandlingIntended(instance ProcessInstance) bool
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopDeploymentWardenDb ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopDeploymentWardenDb() error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopProcesses ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopProcesses() error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopWardenDb ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) LoopWardenDb() error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) MarkInstanceBusinessKeyAsWardenHandled ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) MarkInstanceBusinessKeyAsWardenHandled(businessKey string) string
MarkInstanceAsWardenHandled is intended to be used before the instance is handled by other services
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeployment ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeployment(deploymentId string) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeploymentWardenById ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveDeploymentWardenById(networkId string, deploymentId string) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWarden ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWarden(info WardenInfo) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWardenByBusinessKey ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveInstanceWardenByBusinessKey(networkId string, businessKey string) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveWardenInfoByInstance ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) RemoveWardenInfoByInstance(instance ProcessInstance) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) Start ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) Start(ctx context.Context) error
func (*GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) UpdateWardenInfoDeploymentId ¶
func (this *GenericWarden[WardenInfo, DeploymentWardenInfo, ProcessInstance, History, Incident]) UpdateWardenInfoDeploymentId(networkId string, oldDeploymentId string, newDeploymentId string) error
type Processes ¶
type Processes struct {
// contains filtered or unexported fields
}
func (*Processes) AllInstances ¶
func (*Processes) DeploymentExistsForDeploymentWarden ¶
func (this *Processes) DeploymentExistsForDeploymentWarden(info DeploymentWardenInfo) (exist bool, err error)
func (*Processes) DeploymentExistsForWarden ¶
func (this *Processes) DeploymentExistsForWarden(info WardenInfo) (exist bool, err error)
func (*Processes) GetIncidents ¶
func (*Processes) GetInstanceHistories ¶
func (this *Processes) GetInstanceHistories(info WardenInfo) ([]model.HistoricProcessInstance, error)
func (*Processes) GetInstances ¶
func (this *Processes) GetInstances(info WardenInfo) ([]model.ProcessInstance, error)
func (*Processes) GetYoungestHistory ¶
func (this *Processes) GetYoungestHistory(histories []model.HistoricProcessInstance) (model.HistoricProcessInstance, error)
func (*Processes) GetYoungestIncident ¶
func (*Processes) GetYoungestProcessInstance ¶
func (this *Processes) GetYoungestProcessInstance(instances []model.ProcessInstance) (model.ProcessInstance, error)
func (*Processes) HistoryIsOlderThen ¶
func (*Processes) IncidentIsOlderThen ¶
func (*Processes) InstanceIsCreatedWithWardenHandlingIntended ¶
func (this *Processes) InstanceIsCreatedWithWardenHandlingIntended(instance model.ProcessInstance) bool
func (*Processes) InstanceIsOldPlaceholder ¶
func (this *Processes) InstanceIsOldPlaceholder(instance model.ProcessInstance) (bool, error)
func (*Processes) InstanceIsOlderThen ¶
func (*Processes) MarkInstanceBusinessKeyAsWardenHandled ¶
func (*Processes) Redeploy ¶
func (this *Processes) Redeploy(info DeploymentWardenInfo) error
func (*Processes) Start ¶
func (this *Processes) Start(info WardenInfo) (err error)
type ProcessesInterface ¶
type ProcessesInterface[WardenInfo WardenInfoInterface, DeploymentWardenInfo, ProcessInstance any, History any, Incident any] interface { AllInstances() iter.Seq2[ProcessInstance, error] GetInstances(WardenInfo) ([]ProcessInstance, error) GetYoungestProcessInstance(instances []ProcessInstance) (ProcessInstance, error) InstanceIsOlderThen(ProcessInstance, time.Duration) (bool, error) InstanceIsCreatedWithWardenHandlingIntended(instance ProcessInstance) bool InstanceIsOldPlaceholder(instance ProcessInstance) (bool, error) MarkInstanceBusinessKeyAsWardenHandled(businessKey string) string GetInstanceHistories(WardenInfo) ([]History, error) GetYoungestHistory([]History) (History, error) //by start time? HistoryIsOlderThen(History, time.Duration) (bool, error) GetIncidents(History) ([]Incident, error) GetYoungestIncident([]Incident) (Incident, error) IncidentIsOlderThen(Incident, time.Duration) bool Start(WardenInfo) error Stop(ProcessInstance) error DeploymentExistsForWarden(WardenInfo) (exist bool, err error) DeploymentExistsForDeploymentWarden(DeploymentWardenInfo) (exist bool, err error) Redeploy(DeploymentWardenInfo) error }
type Warden ¶
type Warden = *GenericWarden[WardenInfo, DeploymentWardenInfo, model.ProcessInstance, model.HistoricProcessInstance, model.Incident]
type WardenDb ¶
type WardenDb struct {
// contains filtered or unexported fields
}
func (*WardenDb) GetDeploymentWardenInfo ¶
func (this *WardenDb) GetDeploymentWardenInfo(info WardenInfo) (result DeploymentWardenInfo, exists bool, err error)
func (*WardenDb) GetWardenInfoForDeploymentId ¶
func (this *WardenDb) GetWardenInfoForDeploymentId(deploymentId string) ([]WardenInfo, error)
func (*WardenDb) GetWardenInfoForInstance ¶
func (this *WardenDb) GetWardenInfoForInstance(instance model.ProcessInstance) ([]WardenInfo, error)
func (*WardenDb) ListDeploymentWardenInfo ¶
func (this *WardenDb) ListDeploymentWardenInfo() iter.Seq2[DeploymentWardenInfo, error]
func (*WardenDb) ListWardenInfo ¶
func (this *WardenDb) ListWardenInfo() iter.Seq2[WardenInfo, error]
func (*WardenDb) RemoveDeploymentWardenById ¶
func (*WardenDb) RemoveWardenInfo ¶
func (this *WardenDb) RemoveWardenInfo(info WardenInfo) error
func (*WardenDb) RemoveWardenInfoByBusinessKey ¶
func (*WardenDb) SetDeploymentWardenInfo ¶
func (this *WardenDb) SetDeploymentWardenInfo(info model.DeploymentWardenInfo) error
func (*WardenDb) SetWardenInfo ¶
func (this *WardenDb) SetWardenInfo(info WardenInfo) error
type WardenInfo ¶
type WardenInfo = model.WardenInfo
Click to show internal directories.
Click to hide internal directories.