task

package
v5.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeDeprecation = "deprecation"
	EventTypeWarning     = "warning"

	EventStateStarted    = "started"
	EventStateFinished   = "finished"
	EventStateFailed     = "failed"
	EventStateInProgress = "in_progress"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	TaskID   int
	UnixTime int64 `json:"time"` // e.g 1451020321

	Type    string // e.g. "deprecation"
	Message string

	State string   // e.g. "started"
	Stage string   // e.g. "Preparing deployment"
	Task  string   // e.g. "Binding deployment"
	Tags  []string // e.g. ["api"]

	Total    int // e.g. 0
	Index    int // e.g. 0
	Progress int // e.g. 0

	Data  EventData
	Error *EventError

	StartEvent *Event
}

func (Event) DurationAsStr

func (e Event) DurationAsStr(later Event) string

func (Event) DurationSinceStartAsStr

func (e Event) DurationSinceStartAsStr() string

func (Event) IsSame

func (e Event) IsSame(other Event) bool

func (Event) IsSameGroup

func (e Event) IsSameGroup(other Event) bool

func (Event) IsSameTaskID

func (e Event) IsSameTaskID(other Event) bool

func (Event) IsWorthKeeping

func (e Event) IsWorthKeeping() bool

func (Event) Time

func (e Event) Time() time.Time

func (Event) TimeAsHoursStr

func (e Event) TimeAsHoursStr() string

func (Event) TimeAsStr

func (e Event) TimeAsStr() string

type EventData

type EventData struct {
	Error string // e.g. "'api2/2' is not running after update"
}

type EventError

type EventError struct {
	Code    int    // e.g. 100
	Message string // e.g. "Bosh::Director::Lock::TimeoutError"
}

type Reporter

type Reporter interface {
	TaskStarted(int)
	TaskFinished(int, string)
	TaskOutputChunk(int, []byte)
}

type ReporterImpl

type ReporterImpl struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewReporter

func NewReporter(ui boshui.UI, isForEvents bool) *ReporterImpl

func (*ReporterImpl) TaskFinished

func (r *ReporterImpl) TaskFinished(id int, state string)

func (*ReporterImpl) TaskOutputChunk

func (r *ReporterImpl) TaskOutputChunk(id int, chunk []byte)

func (*ReporterImpl) TaskStarted

func (r *ReporterImpl) TaskStarted(id int)

type Task

type Task interface {
	ID() int
	State() string
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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