handler

package
v0.0.0-...-33f46c2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 33 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 WithCancelTimeout

func WithCancelTimeout(timeout time.Duration) Option

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

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

CleanUp clean up task runner

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

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

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

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

func (*Service) Fetch

func (svc *Service) Fetch()

func (*Service) GetCancelTimeout

func (svc *Service) GetCancelTimeout() (timeout time.Duration)

func (*Service) GetCurrentNode

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

func (*Service) GetExitWatchDuration

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

func (*Service) GetFetchInterval

func (svc *Service) GetFetchInterval() (interval 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(path string) (ok bool)

func (*Service) LockSync

func (svc *Service) LockSync(path string)

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

func (svc *Service) SetCancelTimeout(timeout time.Duration)

func (*Service) SetExitWatchDuration

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

func (*Service) SetFetchInterval

func (svc *Service) SetFetchInterval(interval 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(path string)

Jump to

Keyboard shortcuts

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