Documentation ¶
Index ¶
- type BaseTask
- func (t *BaseTask) AppendBindingContext(context module_manager.BindingContext) *BaseTask
- func (t *BaseTask) DumpAsText() string
- func (t *BaseTask) GetAllowFailure() bool
- func (t *BaseTask) GetBinding() module_manager.BindingType
- func (t *BaseTask) GetBindingContext() []module_manager.BindingContext
- func (t *BaseTask) GetDelay() time.Duration
- func (t *BaseTask) GetFailureCount() int
- func (t *BaseTask) GetName() string
- func (t *BaseTask) GetOnStartupHooks() bool
- func (t *BaseTask) GetType() TaskType
- func (t *BaseTask) IncrementFailureCount()
- func (t *BaseTask) WithAllowFailure(allowFailure bool) *BaseTask
- func (t *BaseTask) WithBinding(binding module_manager.BindingType) *BaseTask
- func (t *BaseTask) WithBindingContext(context []module_manager.BindingContext) *BaseTask
- func (t *BaseTask) WithOnStartupHooks(onStartupHooks bool) *BaseTask
- type FailureCountIncrementable
- type Task
- type TaskType
- type TasksQueue
- type TasksQueueDumper
- type TextDumper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseTask ¶
type BaseTask struct { FailureCount int // Failed executions count Name string // Module or hook name Type TaskType Binding module_manager.BindingType BindingContext []module_manager.BindingContext Delay time.Duration AllowFailure bool // Task considered as 'ok' if hook failed. False by default. Can be true for some schedule hooks. OnStartupHooks bool // Run module onStartup hooks on Addon-operator startup or on module enabled. }
func NewTaskDelay ¶
func (*BaseTask) AppendBindingContext ¶
func (t *BaseTask) AppendBindingContext(context module_manager.BindingContext) *BaseTask
func (*BaseTask) DumpAsText ¶
func (*BaseTask) GetAllowFailure ¶
func (*BaseTask) GetBinding ¶
func (t *BaseTask) GetBinding() module_manager.BindingType
func (*BaseTask) GetBindingContext ¶
func (t *BaseTask) GetBindingContext() []module_manager.BindingContext
func (*BaseTask) GetFailureCount ¶
func (*BaseTask) GetOnStartupHooks ¶
func (*BaseTask) IncrementFailureCount ¶
func (t *BaseTask) IncrementFailureCount()
func (*BaseTask) WithAllowFailure ¶
func (*BaseTask) WithBinding ¶
func (t *BaseTask) WithBinding(binding module_manager.BindingType) *BaseTask
func (*BaseTask) WithBindingContext ¶
func (t *BaseTask) WithBindingContext(context []module_manager.BindingContext) *BaseTask
func (*BaseTask) WithOnStartupHooks ¶
type FailureCountIncrementable ¶
type FailureCountIncrementable interface {
IncrementFailureCount()
}
type Task ¶
type Task interface { GetName() string GetType() TaskType GetBinding() module_manager.BindingType GetBindingContext() []module_manager.BindingContext GetFailureCount() int IncrementFailureCount() GetDelay() time.Duration GetAllowFailure() bool GetOnStartupHooks() bool }
type TaskType ¶
type TaskType string
const ( ModuleDelete TaskType = "TASK_MODULE_DELETE" ModuleRun TaskType = "TASK_MODULE_RUN" ModuleHookRun TaskType = "TASK_MODULE_HOOK_RUN" GlobalHookRun TaskType = "TASK_GLOBAL_HOOK_RUN" DiscoverModulesState TaskType = "TASK_DISCOVER_MODULES_STATE" // удаление релиза без сведений о модуле ModulePurge TaskType = "TASK_MODULE_PURGE" // retry module_manager-а ModuleManagerRetry TaskType = "TASK_MODULE_MANAGER_RETRY" // вспомогательные задачи: задержка и остановка обработки Delay TaskType = "TASK_DELAY" Stop TaskType = "TASK_STOP" )
type TasksQueue ¶
func NewTasksQueue ¶
func NewTasksQueue() *TasksQueue
func (*TasksQueue) Add ¶
func (tq *TasksQueue) Add(task Task)
func (*TasksQueue) DumpReader ¶
func (tq *TasksQueue) DumpReader() io.Reader
прочитать дамп структуры для сохранения во временный файл
func (*TasksQueue) IncrementFailureCount ¶
func (tq *TasksQueue) IncrementFailureCount()
func (*TasksQueue) Peek ¶
func (tq *TasksQueue) Peek() (task Task, err error)
func (*TasksQueue) Push ¶
func (tq *TasksQueue) Push(task Task)
type TasksQueueDumper ¶
type TasksQueueDumper struct { DumpFilePath string // contains filtered or unexported fields }
func NewTasksQueueDumper ¶
func NewTasksQueueDumper(dumpFilePath string, queue *TasksQueue) *TasksQueueDumper
func (*TasksQueueDumper) DumpQueue ¶
func (t *TasksQueueDumper) DumpQueue()
func (*TasksQueueDumper) QueueChangeCallback ¶
func (t *TasksQueueDumper) QueueChangeCallback()
QueueChangeCallback dumps a queue to a dump file when queue changes.
func (*TasksQueueDumper) WatchQueue ¶
func (t *TasksQueueDumper) WatchQueue()
type TextDumper ¶
type TextDumper interface {
DumpAsText() string
}
Click to show internal directories.
Click to hide internal directories.