handler

package
v0.6.0-beta.20210715 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2021 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Index

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 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 WithConfigPath(path string) Option

func WithExitWatchDuration

func WithExitWatchDuration(duration time.Duration) Option

func WithReportInterval

func WithReportInterval(interval time.Duration) Option

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func (*Runner) Cancel

func (r *Runner) Cancel() (err error)

func (*Runner) Dispose

func (r *Runner) Dispose() (err error)

func (*Runner) GetTaskId

func (r *Runner) GetTaskId() (id primitive.ObjectID)

func (*Runner) Init

func (r *Runner) Init() (err error)

func (*Runner) Run

func (r *Runner) Run() (err error)

func (*Runner) SetLogDriverType

func (r *Runner) SetLogDriverType(driverType string)

func (*Runner) SetSubscribeTimeout

func (r *Runner) SetSubscribeTimeout(timeout time.Duration)

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) Cancel

func (svc *Service) Cancel(taskId primitive.ObjectID) (err error)

func (*Service) GetCurrentNode

func (svc *Service) GetCurrentNode() (n interfaces.Node, err error)

func (*Service) GetExitWatchDuration

func (svc *Service) GetExitWatchDuration() (duration time.Duration)

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 (svc *Service) GetReportInterval() (interval time.Duration)

func (*Service) GetSpiderById

func (svc *Service) GetSpiderById(id primitive.ObjectID) (s interfaces.Spider, err error)

func (*Service) GetTaskById

func (svc *Service) GetTaskById(id primitive.ObjectID) (t interfaces.Task, err error)

func (*Service) IsSyncLocked

func (svc *Service) IsSyncLocked(spiderId primitive.ObjectID) (ok bool)

func (*Service) LockSync

func (svc *Service) LockSync(spiderId primitive.ObjectID)

func (*Service) ReportStatus

func (svc *Service) ReportStatus()

func (*Service) Reset

func (svc *Service) Reset()

func (*Service) Run

func (svc *Service) Run(taskId primitive.ObjectID) (err error)

func (*Service) SetExitWatchDuration

func (svc *Service) SetExitWatchDuration(duration time.Duration)

func (*Service) SetReportInterval

func (svc *Service) SetReportInterval(interval time.Duration)

func (*Service) Start

func (svc *Service) Start()

func (*Service) UnlockSync

func (svc *Service) UnlockSync(spiderId primitive.ObjectID)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL