Documentation ¶
Index ¶
- func AddJob(collection *dependencyinjection.ServiceCollection, jobCtor interface{})
- func AddJobs(collection *dependencyinjection.ServiceCollection, jobListCtor ...interface{})
- func GetLogger(logID int64) (*logrus.Logger, error)
- func IsDone(logID int64) bool
- func NewXxlJobBuilder(config abstractions.IConfiguration) *abstractions.HostBuilder
- func UseXxlJob(collection *dependencyinjection.ServiceCollection)
- type ExecutorOptions
- type JobContext
- type JobHandler
- type Logger
- type XxlJobLogger
- type XxlJobService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJob ¶
func AddJob(collection *dependencyinjection.ServiceCollection, jobCtor interface{})
func AddJobs ¶
func AddJobs(collection *dependencyinjection.ServiceCollection, jobListCtor ...interface{})
func NewXxlJobBuilder ¶
func NewXxlJobBuilder(config abstractions.IConfiguration) *abstractions.HostBuilder
func UseXxlJob ¶
func UseXxlJob(collection *dependencyinjection.ServiceCollection)
Types ¶
type ExecutorOptions ¶
type ExecutorOptions struct { ServerAddr string `mapstructure:"serverAddr" config:"serverAddr"` AccessToken string `mapstructure:"accessToken" config:"accessToken"` Timeout time.Duration `mapstructure:"timeout" config:"timeout"` ExecutorIp string `mapstructure:"ip" config:"ip"` ExecutorPort string `mapstructure:"port" config:"port"` RegistryKey string `mapstructure:"registryKey" config:"registryKey"` // application name // contains filtered or unexported fields }
func (*ExecutorOptions) BuildExecutor ¶
func (ops *ExecutorOptions) BuildExecutor() xxl.Executor
BuildExecutor 构造执行器
type JobContext ¶
func GetContext ¶
func GetContext(ctx context.Context, request *xxl.RunReq) *JobContext
func (*JobContext) Report ¶
func (ctx *JobContext) Report(format string, args ...interface{})
Report 上报日志
type JobHandler ¶
type JobHandler interface { // Execute 任务的执行函数 Execute(cxt *JobContext) (msg string) // GetJobName 自定义任务的名字 GetJobName() string }
type XxlJobLogger ¶
type XxlJobLogger struct {
// contains filtered or unexported fields
}
func NewXxlJobLogger ¶
func NewXxlJobLogger(logID int64) (*XxlJobLogger, error)
func (*XxlJobLogger) Done ¶
func (x *XxlJobLogger) Done(msg string) string
func (*XxlJobLogger) Error ¶
func (x *XxlJobLogger) Error(args ...interface{})
func (*XxlJobLogger) Info ¶
func (x *XxlJobLogger) Info(format string, args ...interface{})
type XxlJobService ¶
type XxlJobService struct { Executor xxl.Executor // contains filtered or unexported fields }
XxlJobService as IHostService
func NewXxlJobService ¶
func NewXxlJobService(configuration abstractions.IConfiguration, environment *abstractions.HostEnvironment, jobList []JobHandler) *XxlJobService
func (*XxlJobService) Run ¶
func (service *XxlJobService) Run() error
func (*XxlJobService) Stop ¶
func (service *XxlJobService) Stop() error
Click to show internal directories.
Click to hide internal directories.