task

package
v0.0.0-...-a138482 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PENDING  = "PENDING"
	SUCCEDED = "SUCCEDED"
	FAILED   = "FAILED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Failed

type Failed struct {
	ResultStatus
}

func (Failed) Failed

func (s Failed) Failed() bool

func (Failed) Pending

func (s Failed) Pending() bool

func (Failed) StartedAt

func (s Failed) StartedAt() int64

func (Failed) Succeeded

func (s Failed) Succeeded() bool

type Pending

type Pending struct {
	StartedAt_ int64 `json:"started_at"`
}

func (Pending) Failed

func (s Pending) Failed() bool

func (Pending) Pending

func (s Pending) Pending() bool

func (Pending) StartedAt

func (s Pending) StartedAt() int64

func (Pending) Succeeded

func (s Pending) Succeeded() bool

type PreparedStatus

type PreparedStatus struct {
	Status     string      `json:"status"`
	StartedAt_ int64       `json:"started_at"`
	FinishedAt *int64      `json:"finished_at,omitempty"`
	Details    interface{} `json:"details,omitempty"`
}

func PrepareStatus

func PrepareStatus(status Status) *PreparedStatus

type ResultStatus

type ResultStatus struct {
	StartedAt_ int64       `json:"started_at"`
	FinishedAt int64       `json:"finished_at"`
	Details    interface{} `json:"details"`
}

type Status

type Status interface {
	Pending() bool
	Failed() bool
	Succeeded() bool
	StartedAt() int64
}

type Succeeded

type Succeeded struct {
	ResultStatus
}

func (Succeeded) Failed

func (s Succeeded) Failed() bool

func (Succeeded) Pending

func (s Succeeded) Pending() bool

func (Succeeded) StartedAt

func (s Succeeded) StartedAt() int64

func (Succeeded) Succeeded

func (s Succeeded) Succeeded() bool

type TaskService

type TaskService interface {
	Add(id string)
	Failed(id string, details interface{})
	Succeeded(id string, details interface{})
	Get(id string) Status
}

func CreateTaskService

func CreateTaskService() TaskService

Jump to

Keyboard shortcuts

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