impl

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//KnownJobDemo is name of demo job
	KnownJobDemo = "DEMO"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context ...

func NewContext

func NewContext(sysCtx context.Context, adminClient client.Client) *Context

NewContext ...

func (*Context) Build

func (c *Context) 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 (*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() (string, 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

type DemoJob

type DemoJob struct{}

DemoJob is the job to demostrate the job interface.

func (*DemoJob) MaxFails

func (dj *DemoJob) MaxFails() uint

MaxFails is implementation of same method in Interface.

func (*DemoJob) Run

func (dj *DemoJob) Run(ctx env.JobContext, params map[string]interface{}) error

Run the replication logic here.

func (*DemoJob) ShouldRetry

func (dj *DemoJob) ShouldRetry() bool

ShouldRetry ...

func (*DemoJob) Validate

func (dj *DemoJob) Validate(params map[string]interface{}) error

Validate is implementation of same method in Interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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