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
- type RunnerOption
- type Service
- func (svc *Service) Cancel(taskId primitive.ObjectID) (err error)
- func (svc *Service) Fetch()
- func (svc *Service) GetCancelTimeout() (timeout time.Duration)
- func (svc *Service) GetCurrentNode() (n interfaces.Node, err error)
- func (svc *Service) GetExitWatchDuration() (duration time.Duration)
- func (svc *Service) GetFetchInterval() (interval 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(path string) (ok bool)
- func (svc *Service) LockSync(path string)
- func (svc *Service) ReportStatus()
- func (svc *Service) Reset()
- func (svc *Service) Run(taskId primitive.ObjectID) (err error)
- func (svc *Service) SetCancelTimeout(timeout time.Duration)
- func (svc *Service) SetExitWatchDuration(duration time.Duration)
- func (svc *Service) SetFetchInterval(interval time.Duration)
- func (svc *Service) SetReportInterval(interval time.Duration)
- func (svc *Service) Start()
- func (svc *Service) UnlockSync(path string)
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 WithCancelTimeout ¶
func WithConfigPath ¶
func WithExitWatchDuration ¶
func WithReportInterval ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) SetSubscribeTimeout ¶
type RunnerOption ¶
type RunnerOption func(r interfaces.TaskRunner)
func WithSubscribeTimeout ¶
func WithSubscribeTimeout(timeout time.Duration) RunnerOption
type Service ¶
type Service struct { // dependencies interfaces.TaskBaseService // contains filtered or unexported fields }
func (*Service) GetCancelTimeout ¶
func (*Service) GetCurrentNode ¶
func (svc *Service) GetCurrentNode() (n interfaces.Node, err error)
func (*Service) GetExitWatchDuration ¶
func (*Service) GetFetchInterval ¶
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) SetCancelTimeout ¶
func (*Service) SetExitWatchDuration ¶
func (*Service) SetFetchInterval ¶
func (*Service) SetReportInterval ¶
func (*Service) UnlockSync ¶
Click to show internal directories.
Click to hide internal directories.