job

package
v0.0.0-...-386a0b5 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Done     chan bool
	Progress chan int
	Errors   chan error
	// contains filtered or unexported fields
}

Job is a generic job with its own state

func Get

func Get(id string) *Job

Get finds and returns a job by its id or nil if not found

func New

func New(params interface{}) *Job

New creates a new job

func (*Job) GetErrors

func (j *Job) GetErrors() []string

GetErrors returns errors of this job

func (*Job) GetProgress

func (j *Job) GetProgress() int

GetProgress returns progress of this job

func (*Job) ID

func (j *Job) ID() string

ID returns ID of this job

func (*Job) Params

func (j *Job) Params() interface{}

Params returns params of this job

func (*Job) Start

func (j *Job) Start(worker func(*Job))

Start starts this job by running the given worker func

Jump to

Keyboard shortcuts

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