Documentation
¶
Index ¶
- Variables
- type Callback
- type ModuleManager
- type Service
- func (s *Service) AddLastTaskToMain(t sh_task.Task) error
- func (s *Service) AddLastTaskToQueue(queueName string, t sh_task.Task) error
- func (s *Service) CombineBindingContextForHook(queueName string, t sh_task.Task, stopCombineFn func(tsk sh_task.Task) bool) *shell_operator.CombineResult
- func (s *Service) CreateAndStartQueue(queueName string, callback Callback)
- func (s *Service) DrainNonMainQueue(queueName string)
- func (s *Service) GetNumberOfConvergeTasks() int
- func (s *Service) GetQueueLength(queueName string) int
- func (s *Service) IsQueueExists(queueName string) bool
- func (s *Service) MainQueueHasPendingModuleRunTask(moduleName string) bool
- func (s *Service) ModuleEnsureCRDsTasksInMainQueueAfterId(afterId string) bool
- func (s *Service) RemoveAdjacentConvergeModules(queueName string, afterId string)
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueNotFound = errors.New("queue is not found")
View Source
var MergeTasks = []sh_task.TaskType{task.GlobalHookRun, task.ModuleHookRun}
Functions ¶
This section is empty.
Types ¶
type Callback ¶ added in v1.11.0
func CompactionCallback ¶ added in v1.11.0
func CompactionCallback(moduleManager ModuleManager, logger *log.Logger) Callback
type ModuleManager ¶ added in v1.11.0
type ModuleManager interface {
GlobalSynchronizationState() *modules.SynchronizationState
GetModule(moduleName string) *modules.BasicModule
}
type Service ¶
type Service struct {
Handle func(ctx context.Context, t sh_task.Task) queue.TaskResult
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddLastTaskToQueue ¶
func (*Service) CombineBindingContextForHook ¶
func (s *Service) CombineBindingContextForHook(queueName string, t sh_task.Task, stopCombineFn func(tsk sh_task.Task) bool) *shell_operator.CombineResult
func (*Service) CreateAndStartQueue ¶
CreateAndStartQueue creates a named queue with default handler and starts it. It returns false is queue is already created
func (*Service) DrainNonMainQueue ¶
func (*Service) GetNumberOfConvergeTasks ¶
func (*Service) GetQueueLength ¶ added in v1.10.0
func (*Service) IsQueueExists ¶
IsQueueExists returns true is queue is already created
func (*Service) MainQueueHasPendingModuleRunTask ¶
queueHasPendingModuleRunTask returns true if queue has pending tasks with the type "ModuleRun" related to the module "moduleName".
func (*Service) ModuleEnsureCRDsTasksInMainQueueAfterId ¶
func (*Service) RemoveAdjacentConvergeModules ¶
RemoveAdjacentConvergeModules removes ConvergeModules tasks right after the task with the specified ID.
type ServiceConfig ¶
type ServiceConfig struct {
Engine *shell_operator.ShellOperator
Handle func(ctx context.Context, t sh_task.Task) queue.TaskResult
}
Click to show internal directories.
Click to hide internal directories.