progress

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess    = "success"
	StatusFailed     = "failed"
	StatusInProgress = "in_progress"
	StatusPending    = "pending"
)

Variables

View Source
var ErrPipeline = errors.New("pipeline has encountered an error")

Functions

func EventToPipeline

func EventToPipeline(event *sdk.EventItem, options *Options) (*sdk.PipelineItem, error)

func Pipeline

func Pipeline(pipelineID string, options *Options) error

Types

type Options

type Options struct {
	Interval time.Duration
}

func NewOptions

func NewOptions() *Options

type PipelineStatus

type PipelineStatus int
const (
	PipelineWorking PipelineStatus = iota
	PipelineFinished
	PipelineFailed
	PipelineUnknownState
)

type PipelineSyncer

type PipelineSyncer func() (*sdk.PipelineItem, error)

type Progress

type Progress struct {
	Options Options
	// contains filtered or unexported fields
}

func NewPipeline

func NewPipeline(options Options) *Progress

func (*Progress) Start

func (p *Progress) Start()

func (*Progress) Stop

func (p *Progress) Stop()

func (*Progress) Update

func (p *Progress) Update(pipelineSync PipelineSyncer) error

func (*Progress) UpdatePipeline

func (p *Progress) UpdatePipeline(pipeline *sdk.PipelineItem) (bool, error)

type UpdateStatus

type UpdateStatus int
const (
	Failed UpdateStatus = iota
	Success

	Synced
)

Jump to

Keyboard shortcuts

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