Documentation ¶
Index ¶
- Constants
- func NewDefaultContext(sysCtx context.Context) env.JobContext
- type Context
- func (c *Context) Build(dep env.JobData) (env.JobContext, error)
- func (c *Context) Checkin(status string) error
- func (c *Context) Get(prop string) (interface{}, bool)
- func (c *Context) GetLogger() logger.Interface
- func (c *Context) Init() error
- func (c *Context) LaunchJob(req jmodel.JobRequest) (jmodel.JobStats, error)
- func (c *Context) OPCommand() (string, bool)
- func (c *Context) SystemContext() context.Context
- type DefaultContext
- func (c *DefaultContext) Build(dep env.JobData) (env.JobContext, error)
- func (c *DefaultContext) Checkin(status string) error
- func (c *DefaultContext) Get(prop string) (interface{}, bool)
- func (c *DefaultContext) GetLogger() logger.Interface
- func (c *DefaultContext) LaunchJob(req jmodel.JobRequest) (jmodel.JobStats, error)
- func (c *DefaultContext) OPCommand() (string, bool)
- func (c *DefaultContext) SystemContext() context.Context
- type DemoJob
Constants ¶
const (
// KnownJobDemo is name of demo job
KnownJobDemo = "DEMO"
)
Variables ¶
This section is empty.
Functions ¶
func NewDefaultContext ¶ added in v1.7.0
func NewDefaultContext(sysCtx context.Context) env.JobContext
NewDefaultContext is constructor of building DefaultContext
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context ...
func NewContext ¶
NewContext ...
func (*Context) Build ¶
Build implements the same method in env.JobContext interface This func will build the job execution context before running
func (*Context) OPCommand ¶
OPCommand return the control operational command like stop/cancel if have
func (*Context) SystemContext ¶
SystemContext implements the same method in env.JobContext interface
type DefaultContext ¶ added in v1.7.0
type DefaultContext struct {
// contains filtered or unexported fields
}
DefaultContext provides a basic job context
func (*DefaultContext) Build ¶ added in v1.7.0
func (c *DefaultContext) Build(dep env.JobData) (env.JobContext, error)
Build implements the same method in env.JobContext interface This func will build the job execution context before running
func (*DefaultContext) Checkin ¶ added in v1.7.0
func (c *DefaultContext) Checkin(status string) error
Checkin is bridge func for reporting detailed status
func (*DefaultContext) Get ¶ added in v1.7.0
func (c *DefaultContext) Get(prop string) (interface{}, bool)
Get implements the same method in env.JobContext interface
func (*DefaultContext) GetLogger ¶ added in v1.7.0
func (c *DefaultContext) GetLogger() logger.Interface
GetLogger returns the logger
func (*DefaultContext) LaunchJob ¶ added in v1.7.0
func (c *DefaultContext) LaunchJob(req jmodel.JobRequest) (jmodel.JobStats, error)
LaunchJob launches sub jobs
func (*DefaultContext) OPCommand ¶ added in v1.7.0
func (c *DefaultContext) OPCommand() (string, bool)
OPCommand return the control operational command like stop/cancel if have
func (*DefaultContext) SystemContext ¶ added in v1.7.0
func (c *DefaultContext) SystemContext() context.Context
SystemContext implements the same method in env.JobContext interface
type DemoJob ¶
type DemoJob struct{}
DemoJob is the job to demostrate the job interface.