Documentation ¶
Index ¶
- func GetTaskHandlerService(path string, opts ...Option) (svr interfaces.TaskHandlerService, err error)
- func NewTaskHandlerService(opts ...Option) (svc2 interfaces.TaskHandlerService, err error)
- func NewTaskRunner(id primitive.ObjectID, svc interfaces.TaskHandlerService, opts ...RunnerOption) (r2 interfaces.TaskRunner, err error)
- func ProvideGetTaskHandlerService(path string, opts ...Option) func() (svr interfaces.TaskHandlerService, err error)
- func ProvideTaskHandlerService(path string, opts ...Option) func() (svc interfaces.TaskHandlerService, err error)
- type Option
- type Runner
- func (r *Runner) Cancel() (err error)
- func (r *Runner) Dispose() (err error)
- func (r *Runner) GetTaskId() (id primitive.ObjectID)
- func (r *Runner) Init() (err error)
- func (r *Runner) Run() (err error)
- func (r *Runner) SetLogDriverType(driverType string)
- func (r *Runner) SetSubscribeTimeout(timeout time.Duration)
- type RunnerOption
- type Service
- func (svc *Service) Cancel(taskId primitive.ObjectID) (err error)
- func (svc *Service) GetCurrentNode() (n interfaces.Node, err error)
- func (svc *Service) GetExitWatchDuration() (duration time.Duration)
- func (svc *Service) GetModelService() (modelSvc interfaces.GrpcClientModelService)
- func (svc *Service) GetModelSpiderService() (modelSpiderSvc interfaces.GrpcClientModelSpiderService)
- func (svc *Service) GetModelTaskService() (modelTaskSvc interfaces.GrpcClientModelTaskService)
- func (svc *Service) GetModelTaskStatService() (modelTaskSvc interfaces.GrpcClientModelTaskStatService)
- func (svc *Service) GetNodeConfigService() (cfgSvc interfaces.NodeConfigService)
- func (svc *Service) GetReportInterval() (interval time.Duration)
- func (svc *Service) GetSpiderById(id primitive.ObjectID) (s interfaces.Spider, err error)
- func (svc *Service) GetTaskById(id primitive.ObjectID) (t interfaces.Task, err error)
- func (svc *Service) IsSyncLocked(spiderId primitive.ObjectID) (ok bool)
- func (svc *Service) LockSync(spiderId primitive.ObjectID)
- func (svc *Service) ReportStatus()
- func (svc *Service) Reset()
- func (svc *Service) Run(taskId primitive.ObjectID) (err error)
- func (svc *Service) SetExitWatchDuration(duration time.Duration)
- func (svc *Service) SetReportInterval(interval time.Duration)
- func (svc *Service) Start()
- func (svc *Service) UnlockSync(spiderId primitive.ObjectID)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTaskHandlerService ¶
func GetTaskHandlerService(path string, opts ...Option) (svr interfaces.TaskHandlerService, err error)
func NewTaskHandlerService ¶
func NewTaskHandlerService(opts ...Option) (svc2 interfaces.TaskHandlerService, err error)
func NewTaskRunner ¶
func NewTaskRunner(id primitive.ObjectID, svc interfaces.TaskHandlerService, opts ...RunnerOption) (r2 interfaces.TaskRunner, err error)
func ProvideGetTaskHandlerService ¶
func ProvideGetTaskHandlerService(path string, opts ...Option) func() (svr interfaces.TaskHandlerService, err error)
func ProvideTaskHandlerService ¶
func ProvideTaskHandlerService(path string, opts ...Option) func() (svc interfaces.TaskHandlerService, err error)
Types ¶
type Option ¶
type Option func(svc interfaces.TaskHandlerService)
func WithConfigPath ¶
func WithExitWatchDuration ¶
func WithReportInterval ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) SetLogDriverType ¶
func (*Runner) SetSubscribeTimeout ¶
type RunnerOption ¶
type RunnerOption func(r interfaces.TaskRunner)
func WithLogDriverType ¶
func WithLogDriverType(driverType string) RunnerOption
func WithSubscribeTimeout ¶
func WithSubscribeTimeout(timeout time.Duration) RunnerOption
type Service ¶
type Service struct { // dependencies interfaces.TaskBaseService // contains filtered or unexported fields }
func (*Service) GetCurrentNode ¶
func (svc *Service) GetCurrentNode() (n interfaces.Node, err error)
func (*Service) GetExitWatchDuration ¶
func (*Service) GetModelService ¶
func (svc *Service) GetModelService() (modelSvc interfaces.GrpcClientModelService)
func (*Service) GetModelSpiderService ¶
func (svc *Service) GetModelSpiderService() (modelSpiderSvc interfaces.GrpcClientModelSpiderService)
func (*Service) GetModelTaskService ¶
func (svc *Service) GetModelTaskService() (modelTaskSvc interfaces.GrpcClientModelTaskService)
func (*Service) GetModelTaskStatService ¶
func (svc *Service) GetModelTaskStatService() (modelTaskSvc interfaces.GrpcClientModelTaskStatService)
func (*Service) GetNodeConfigService ¶
func (svc *Service) GetNodeConfigService() (cfgSvc interfaces.NodeConfigService)
func (*Service) GetReportInterval ¶
func (*Service) GetSpiderById ¶
func (*Service) GetTaskById ¶
func (*Service) IsSyncLocked ¶
func (*Service) ReportStatus ¶
func (svc *Service) ReportStatus()
func (*Service) SetExitWatchDuration ¶
func (*Service) SetReportInterval ¶
func (*Service) UnlockSync ¶
Click to show internal directories.
Click to hide internal directories.