jobsv1

package
v0.0.6-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(config jobs.Config, repo jobs.Repository) jobs.Manager

NewManager returns a JobManager implementation.

func NewRepository

func NewRepository(repo storage.Repository) jobs.Repository

NewRepository registers the the Job model and returns the an implementation of the Repository.

Types

type BaseTask

type BaseTask struct {
	JobID jobs.JobID

	// state
	JobManager jobs.Manager
}

BaseTask holds the required details and helper functions for tasks to update jobs. should be embedded into the task

func (*BaseTask) ParseJobID

func (b *BaseTask) ParseJobID(taskTypeName string, kwargs map[string]interface{}) error

ParseJobID parses JobID.

func (*BaseTask) UpdateJob

func (b *BaseTask) UpdateJob(accountID identity.DID, taskTypeName string, err error) error

UpdateJob add a new log and updates the status of the job based on the error.

func (*BaseTask) UpdateJobWithValue

func (b *BaseTask) UpdateJobWithValue(accountID identity.DID, taskTypeName string, err error, txValue *jobs.JobValue) error

UpdateJobWithValue add a new log and updates the status of the transaction based on the error and adds a value to the tx

type Bootstrapper

type Bootstrapper struct{}

Bootstrapper implements bootstrap.Bootstrapper.

func (Bootstrapper) Bootstrap

func (b Bootstrapper) Bootstrap(ctx map[string]interface{}) error

Bootstrap adds transaction.Repository into context.

Jump to

Keyboard shortcuts

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