Documentation ¶
Index ¶
- func NewDefaultContext(sysCtx context.Context) job.Context
- type Context
- func (c *Context) Build(tracker job.Tracker) (job.Context, 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) OPCommand() (job.OPCommand, bool)
- func (c *Context) SystemContext() context.Context
- func (c *Context) Tracker() job.Tracker
- type DefaultContext
- func (dc *DefaultContext) Build(t job.Tracker) (job.Context, error)
- func (dc *DefaultContext) Checkin(status string) error
- func (dc *DefaultContext) Get(prop string) (interface{}, bool)
- func (dc *DefaultContext) GetLogger() logger.Interface
- func (dc *DefaultContext) OPCommand() (job.OPCommand, bool)
- func (dc *DefaultContext) SystemContext() context.Context
- func (dc *DefaultContext) Tracker() job.Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context ...
func NewContext ¶
func NewContext(sysCtx context.Context, cfgMgr *comcfg.CfgManager) *Context
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 ¶
type DefaultContext struct {
// contains filtered or unexported fields
}
DefaultContext provides a basic job context
func (*DefaultContext) Build ¶
Build implements the same method in env.Context interface This func will build the job execution context before running
func (*DefaultContext) Checkin ¶
func (dc *DefaultContext) Checkin(status string) error
Checkin is bridge func for reporting detailed status
func (*DefaultContext) Get ¶
func (dc *DefaultContext) Get(prop string) (interface{}, bool)
Get implements the same method in env.Context interface
func (*DefaultContext) GetLogger ¶
func (dc *DefaultContext) GetLogger() logger.Interface
GetLogger returns the logger
func (*DefaultContext) OPCommand ¶
func (dc *DefaultContext) OPCommand() (job.OPCommand, bool)
OPCommand return the control operational command like stop if have
func (*DefaultContext) SystemContext ¶
func (dc *DefaultContext) SystemContext() context.Context
SystemContext implements the same method in env.Context interface
func (*DefaultContext) Tracker ¶
func (dc *DefaultContext) Tracker() job.Tracker
Tracker returns the tracker tracking the job attached with the context