Documentation ¶
Index ¶
- Constants
- Variables
- func CancelUpdateProjectTagsTaskName(svcName string) cereal.TaskName
- func ProjectTagUpdaterStatusTaskName(svcName string) cereal.TaskName
- func ProjectUpdateBackend(conn *grpc.ClientConn) cereal.Driver
- func RegisterSerialTaskExecutors(manager *cereal.Manager, svc string, client SerializedProjectUpdate, ...) error
- func RegisterTaskExecutors(manager *cereal.Manager, domainService string, esClient EsClient, ...) error
- func StartProjectTagUpdaterTaskName(svcName string) cereal.TaskName
- type DomainProjectUpdateWorkflowExecutor
- func (m *DomainProjectUpdateWorkflowExecutor) OnCancel(w cereal.WorkflowInstance, ev cereal.CancelEvent) cereal.Decision
- func (m *DomainProjectUpdateWorkflowExecutor) OnStart(w cereal.WorkflowInstance, ev cereal.StartEvent) cereal.Decision
- func (m *DomainProjectUpdateWorkflowExecutor) OnTaskComplete(w cereal.WorkflowInstance, ev cereal.TaskCompleteEvent) cereal.Decision
- type DomainProjectUpdateWorkflowParameters
- type DomainProjectUpdateWorkflowPayload
- type ESCancelUpdateProjectTagsTask
- type ESProjectTagUpdaterStatusTask
- type ESStartProjectTagUpdaterTask
- type EsClient
- type JobStatus
- type SerializedProjectUpdate
- type SerializedProjectUpdateCancelTaskTaskParams
- type SerializedProjectUpdateCancelTaskTaskResult
- type SerializedProjectUpdateListTasksTaskParams
- type SerializedProjectUpdateListTasksTaskResult
- type SerializedProjectUpdateMonitorTaskTaskParams
- type SerializedProjectUpdateMonitorTaskTaskResult
- type SerializedProjectUpdateRunTaskTaskParams
- type SerializedProjectUpdateRunTaskTaskResult
- type SerializedProjectUpdateTask
- type SerializedProjectUpdateTaskID
- type SerializedProjectUpdateTaskState
- type SerializedProjectUpdateTaskStatus
- type SerializedProjectUpdateWorkflowExecutor
- func (m *SerializedProjectUpdateWorkflowExecutor) OnCancel(w cereal.WorkflowInstance, ev cereal.CancelEvent) cereal.Decision
- func (m *SerializedProjectUpdateWorkflowExecutor) OnStart(w cereal.WorkflowInstance, ev cereal.StartEvent) cereal.Decision
- func (m *SerializedProjectUpdateWorkflowExecutor) OnTaskComplete(w cereal.WorkflowInstance, ev cereal.TaskCompleteEvent) cereal.Decision
- type SerializedProjectUpdateWorkflowParams
- type SerializedProjectUpdateWorkflowPhase
- type SerializedProjectUpdateWorkflowState
- type StartResult
- type StatusParameters
Constants ¶
const ( SerializedProjectUpdateListTaskType = "project-update-list-tasks" SerializedProjectUpdateRunTaskType = "project-update-run-task" SerializedProjectUpdateMonitorTaskType = "project-update-monitor-task" SerializedProjectUpdateCancelTaskType = "project-update-cancel-task" )
const (
// ProjectUpdateIDTag - The tag used to designate the project update job
ProjectUpdateIDTag = "ProjectUpdateID"
)
Variables ¶
var ErrNoJobIDs = errors.New("0 Job IDs returned")
var NoStatus = SerializedProjectUpdateTaskStatus{}
Functions ¶
func ProjectUpdateBackend ¶
func ProjectUpdateBackend(conn *grpc.ClientConn) cereal.Driver
ProjectUpdateBackend takes a connection to cereal-service and returns a cereal backend with the correct domain for project updates
func RegisterSerialTaskExecutors ¶
func RegisterSerialTaskExecutors(manager *cereal.Manager, svc string, client SerializedProjectUpdate, authzProjectsServiceClient authz.ProjectsServiceClient) error
func RegisterTaskExecutors ¶
Types ¶
type DomainProjectUpdateWorkflowExecutor ¶
type DomainProjectUpdateWorkflowExecutor struct { PollInterval time.Duration // contains filtered or unexported fields }
func NewWorkflowExecutorForDomainService ¶
func NewWorkflowExecutorForDomainService(domainService string) *DomainProjectUpdateWorkflowExecutor
func (*DomainProjectUpdateWorkflowExecutor) OnCancel ¶
func (m *DomainProjectUpdateWorkflowExecutor) OnCancel( w cereal.WorkflowInstance, ev cereal.CancelEvent) cereal.Decision
func (*DomainProjectUpdateWorkflowExecutor) OnStart ¶
func (m *DomainProjectUpdateWorkflowExecutor) OnStart( w cereal.WorkflowInstance, ev cereal.StartEvent) cereal.Decision
func (*DomainProjectUpdateWorkflowExecutor) OnTaskComplete ¶
func (m *DomainProjectUpdateWorkflowExecutor) OnTaskComplete( w cereal.WorkflowInstance, ev cereal.TaskCompleteEvent) cereal.Decision
type DomainProjectUpdateWorkflowParameters ¶
type DomainProjectUpdateWorkflowParameters struct {
ProjectUpdateID string
}
type ESCancelUpdateProjectTagsTask ¶
type ESCancelUpdateProjectTagsTask struct {
// contains filtered or unexported fields
}
type ESProjectTagUpdaterStatusTask ¶
type ESProjectTagUpdaterStatusTask struct {
// contains filtered or unexported fields
}
type ESStartProjectTagUpdaterTask ¶
type ESStartProjectTagUpdaterTask struct {
// contains filtered or unexported fields
}
type JobStatus ¶
JobStatus - the current status of a job
func FindSlowestJobStatus ¶
FindSlowestJobStatus - merge multiple job statuses into one. Return the status that is going to finish last.
type SerializedProjectUpdate ¶
type SerializedProjectUpdate interface { ListProjectUpdateTasks(ctx context.Context) ([]SerializedProjectUpdateTask, error) RunProjectUpdateTask(ctx context.Context, projectUpdateID string, params map[string]string, projectTaggingRules map[string]*authz.ProjectRules) (SerializedProjectUpdateTaskID, SerializedProjectUpdateTaskStatus, error) MonitorProjectUpdateTask(ctx context.Context, projectUpdateID string, id SerializedProjectUpdateTaskID) (SerializedProjectUpdateTaskStatus, error) CancelProjectUpdateTask(ctx context.Context, projectUpdateID string, id SerializedProjectUpdateTaskID) error }
type SerializedProjectUpdateCancelTaskTaskParams ¶
type SerializedProjectUpdateCancelTaskTaskParams struct { ProjectUpdateID string ID SerializedProjectUpdateTaskID }
type SerializedProjectUpdateCancelTaskTaskResult ¶
type SerializedProjectUpdateCancelTaskTaskResult struct { }
type SerializedProjectUpdateListTasksTaskParams ¶
type SerializedProjectUpdateListTasksTaskParams struct{}
type SerializedProjectUpdateListTasksTaskResult ¶
type SerializedProjectUpdateListTasksTaskResult struct {
Tasks []SerializedProjectUpdateTask
}
type SerializedProjectUpdateMonitorTaskTaskParams ¶
type SerializedProjectUpdateMonitorTaskTaskParams struct { ProjectUpdateID string ID SerializedProjectUpdateTaskID }
type SerializedProjectUpdateMonitorTaskTaskResult ¶
type SerializedProjectUpdateMonitorTaskTaskResult struct {
Status SerializedProjectUpdateTaskStatus
}
type SerializedProjectUpdateRunTaskTaskResult ¶
type SerializedProjectUpdateRunTaskTaskResult struct { ID SerializedProjectUpdateTaskID Status SerializedProjectUpdateTaskStatus }
type SerializedProjectUpdateTaskID ¶
type SerializedProjectUpdateTaskID string
const SerializedProjectUpdateTaskIDUnknown SerializedProjectUpdateTaskID = ""
type SerializedProjectUpdateTaskState ¶
type SerializedProjectUpdateTaskState string
const ( SerializedProjectUpdateTaskRunning SerializedProjectUpdateTaskState = "running" SerializedProjectUpdateTaskFailed SerializedProjectUpdateTaskState = "failed" SerializedProjectUpdateTaskSuccess SerializedProjectUpdateTaskState = "success" )
type SerializedProjectUpdateTaskStatus ¶
type SerializedProjectUpdateTaskStatus struct { State SerializedProjectUpdateTaskState PercentageComplete float32 Metadata map[string]string Error string }
type SerializedProjectUpdateWorkflowExecutor ¶
SerializedProjectUpdateWorkflowExecutor is a workflow that allows running 1 task at a time across many services. Given a list of services, it first asks each service to list what tasks it would like to run. For example, a service would return a task to run for each elasticsearch index to update. After the tasks have been gathered for all services, the workflow executes them 1 at a time. Once a task is started, it is monitored until completion. The next task does not start until the completion of the previous one. If a task fails, the workflow does not continue.
func NewSerializedWorkflowExecutor ¶
func NewSerializedWorkflowExecutor() *SerializedProjectUpdateWorkflowExecutor
func (*SerializedProjectUpdateWorkflowExecutor) OnCancel ¶
func (m *SerializedProjectUpdateWorkflowExecutor) OnCancel( w cereal.WorkflowInstance, ev cereal.CancelEvent) cereal.Decision
func (*SerializedProjectUpdateWorkflowExecutor) OnStart ¶
func (m *SerializedProjectUpdateWorkflowExecutor) OnStart( w cereal.WorkflowInstance, ev cereal.StartEvent) cereal.Decision
func (*SerializedProjectUpdateWorkflowExecutor) OnTaskComplete ¶
func (m *SerializedProjectUpdateWorkflowExecutor) OnTaskComplete( w cereal.WorkflowInstance, ev cereal.TaskCompleteEvent) cereal.Decision
type SerializedProjectUpdateWorkflowPhase ¶
type SerializedProjectUpdateWorkflowPhase string
const ( SerializedProjectUpdateWorkflowPhaseStarting SerializedProjectUpdateWorkflowPhase = "starting" SerializedProjectUpdateWorkflowPhaseRunning SerializedProjectUpdateWorkflowPhase = "running" SerializedProjectUpdateWorkflowPhaseComplete SerializedProjectUpdateWorkflowPhase = "complete" SerializedProjectUpdateWorkflowPhaseCanceling SerializedProjectUpdateWorkflowPhase = "canceling" )
type SerializedProjectUpdateWorkflowState ¶
type SerializedProjectUpdateWorkflowState struct { ProjectUpdateID string DomainServices []string Phase SerializedProjectUpdateWorkflowPhase Starting serializedProjectUpdateWorkflowPhaseStartingData Running serializedProjectUpdateWorkflowPhaseRunningData MonitorFailures int }
type StartResult ¶
type StatusParameters ¶
type StatusParameters struct {
JobIDs []string
}