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 ¶ 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
Build implements the same method in env.Context interface This func will build the job execution context before running
func (*DefaultContext) Checkin ¶ added in v1.7.0
func (dc *DefaultContext) Checkin(status string) error
Checkin is bridge func for reporting detailed status
func (*DefaultContext) Get ¶ added in v1.7.0
func (dc *DefaultContext) Get(prop string) (interface{}, bool)
Get implements the same method in env.Context interface
func (*DefaultContext) GetLogger ¶ added in v1.7.0
func (dc *DefaultContext) GetLogger() logger.Interface
GetLogger returns the logger
func (*DefaultContext) OPCommand ¶ added in v1.7.0
func (dc *DefaultContext) OPCommand() (job.OPCommand, bool)
OPCommand return the control operational command like stop if have
func (*DefaultContext) SystemContext ¶ added in v1.7.0
func (dc *DefaultContext) SystemContext() context.Context
SystemContext implements the same method in env.Context interface
func (*DefaultContext) Tracker ¶ added in v1.8.0
func (dc *DefaultContext) Tracker() job.Tracker
Tracker returns the tracker tracking the job attached with the context