Documentation
¶
Index ¶
- func SetTaskConfig(dir string, name string)
- type Batch
- type EtlTask
- type LogFunc
- type LogLevel
- type Status
- type Syncer
- type TaskManager
- func (t *TaskManager) Add(aTask *EtlTask) *TaskManager
- func (t *TaskManager) Build() error
- func (t *TaskManager) Execute(taskName string) error
- func (t *TaskManager) GetAllTasks() map[string]*EtlTask
- func (t *TaskManager) Reset(taskName string) error
- func (t *TaskManager) SetLog(log LogFunc)
- func (t *TaskManager) SetRepo(repo TaskStatusRepository)
- func (t *TaskManager) Start(taskName string) error
- func (t *TaskManager) Stop(taskName string) error
- type TaskState
- type TaskStatus
- type TaskStatusRepository
- type TaskType
- type TaskWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetTaskConfig ¶
SetTaskConfig set config dir for config file, default search for config, cfgName is no need extension
Types ¶
type EtlTask ¶
type EtlTask struct { Batch Batch Syncers []Syncer Type TaskType PlanTime string // this time use cron format time ResetBeforeBegin bool StatusChanged chan<- *EtlTask Status }
EtlTask indicate a task operate etl
func (*EtlTask) GetTaskStatus ¶ added in v1.1.0
func (e *EtlTask) GetTaskStatus() TaskStatus
func (*EtlTask) IsAvailable ¶ added in v1.1.0
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
func NewTaskManager ¶
func NewTaskManager() *TaskManager
func (*TaskManager) Add ¶
func (t *TaskManager) Add(aTask *EtlTask) *TaskManager
Add add a name unique task
func (*TaskManager) Build ¶
func (t *TaskManager) Build() error
Build taskmanager, it will do oneshot task first and add plan task to cron then if you specified repo, will recover task status and remove unnecessary task status
func (*TaskManager) GetAllTasks ¶
func (t *TaskManager) GetAllTasks() map[string]*EtlTask
GetAllTasks this method is commonly used by dashserver
func (*TaskManager) SetLog ¶
func (t *TaskManager) SetLog(log LogFunc)
SetLog if you want log err messages
func (*TaskManager) SetRepo ¶ added in v1.1.0
func (t *TaskManager) SetRepo(repo TaskStatusRepository)
SetRepo if you need persist task status
type TaskState ¶
type TaskState uint
TaskState task state
type TaskStatus ¶ added in v1.1.0
type TaskStatusRepository ¶ added in v1.1.0
type TaskStatusRepository interface { GetAll() ([]TaskStatus, error) InsertOrUpdate(ts TaskStatus) error RemoveLegacy(newTs map[string]*EtlTask) error }
type TaskType ¶
type TaskType uint
TaskType task type
type TaskWrapper ¶
type TaskWrapper struct {
// contains filtered or unexported fields
}
func NewTaskWrapper ¶
func NewTaskWrapper(log LogFunc, component *EtlTask) TaskWrapper
NewTaskWrapper return a wrapper for cron
Click to show internal directories.
Click to hide internal directories.