Documentation ¶
Index ¶
- type BaseTask
- func (t *BaseTask) AppendBindingContext(context hook.BindingContext) *BaseTask
- func (t *BaseTask) DumpAsText() string
- func (t *BaseTask) GetAllowFailure() bool
- func (t *BaseTask) GetBinding() hook.BindingType
- func (t *BaseTask) GetBindingContext() []hook.BindingContext
- func (t *BaseTask) GetDelay() time.Duration
- func (t *BaseTask) GetFailureCount() int
- func (t *BaseTask) GetName() string
- func (t *BaseTask) GetType() TaskType
- func (t *BaseTask) IncrementFailureCount()
- func (t *BaseTask) WithAllowFailure(allowFailure bool) *BaseTask
- func (t *BaseTask) WithBinding(binding hook.BindingType) *BaseTask
- func (t *BaseTask) WithBindingContext(context []hook.BindingContext) *BaseTask
- type FailureCountIncrementable
- type Task
- type TaskType
- type TasksQueue
- 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 // hook name Type TaskType Binding hook.BindingType BindingContext []hook.BindingContext Delay time.Duration AllowFailure bool // Task considered as 'ok' if hook failed. False by default. Can be true for some schedule hooks. }
func NewTaskDelay ¶
func (*BaseTask) AppendBindingContext ¶
func (t *BaseTask) AppendBindingContext(context hook.BindingContext) *BaseTask
func (*BaseTask) DumpAsText ¶
func (*BaseTask) GetAllowFailure ¶
func (*BaseTask) GetBinding ¶
func (t *BaseTask) GetBinding() hook.BindingType
func (*BaseTask) GetBindingContext ¶
func (t *BaseTask) GetBindingContext() []hook.BindingContext
func (*BaseTask) GetFailureCount ¶
func (*BaseTask) IncrementFailureCount ¶
func (t *BaseTask) IncrementFailureCount()
func (*BaseTask) WithAllowFailure ¶
func (*BaseTask) WithBinding ¶
func (t *BaseTask) WithBinding(binding hook.BindingType) *BaseTask
func (*BaseTask) WithBindingContext ¶
func (t *BaseTask) WithBindingContext(context []hook.BindingContext) *BaseTask
type FailureCountIncrementable ¶
type FailureCountIncrementable interface {
IncrementFailureCount()
}
type Task ¶
type Task interface { GetName() string GetType() TaskType GetBinding() hook.BindingType GetBindingContext() []hook.BindingContext GetFailureCount() int IncrementFailureCount() GetDelay() time.Duration GetAllowFailure() bool }
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 TextDumper ¶
type TextDumper interface {
DumpAsText() string
}
Click to show internal directories.
Click to hide internal directories.