impl

package
v0.0.0-...-969384c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 62

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultContext

func NewDefaultContext(sysCtx context.Context) job.Context

NewDefaultContext is constructor of building DefaultContext

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context ...

func NewContext

func NewContext(sysCtx context.Context, cfgMgr libCfg.Manager) *Context

NewContext ...

func (*Context) Build

func (c *Context) Build(tracker job.Tracker) (job.Context, error)

Build implements the same method in env.JobContext interface This func will build the job execution context before running

func (*Context) Checkin

func (c *Context) Checkin(status string) error

Checkin is bridge func for reporting detailed status

func (*Context) Get

func (c *Context) Get(prop string) (interface{}, bool)

Get implements the same method in env.JobContext interface

func (*Context) GetLogger

func (c *Context) GetLogger() logger.Interface

GetLogger returns the logger

func (*Context) Init

func (c *Context) Init() error

Init ...

func (*Context) OPCommand

func (c *Context) OPCommand() (job.OPCommand, bool)

OPCommand return the control operational command like stop/cancel if have

func (*Context) SystemContext

func (c *Context) SystemContext() context.Context

SystemContext implements the same method in env.JobContext interface

func (*Context) Tracker

func (c *Context) Tracker() job.Tracker

Tracker returns the job tracker attached with the context

type DefaultContext

type DefaultContext struct {
	// contains filtered or unexported fields
}

DefaultContext provides a basic job context

func (*DefaultContext) Build

func (dc *DefaultContext) Build(t job.Tracker) (job.Context, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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