progress

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LastResult

type LastResult struct {
	LastResultName          string
	LastCompletedPercentage uint32
	LastUpdate              time.Time
}

type Monitor

type Monitor struct {
	UploadClient  upload.Uploader
	TaskCompleted chan error
	SendResult    func(request *pb.ResultMetadataRequest) error
	// contains filtered or unexported fields
}

func NewProgressMonitor

func NewProgressMonitor(
	taskId, instanceId, resultsDir, instanceType, progressFile string,
	pollProgress bool,
	pollProgressInterval time.Duration,
	progressUpdateTimeout time.Duration,
	resultHandlingStrategy types.ResultHandlingStrategy,
	sendResult func(request *pb.ResultMetadataRequest) error) *Monitor

func (*Monitor) SendErrorProgressMessage

func (m *Monitor) SendErrorProgressMessage(detail string)

func (*Monitor) SendExceedMaxDurationResult

func (m *Monitor) SendExceedMaxDurationResult() error

Send an one-time result in current progress file. Should be only invoked on task failures.

func (*Monitor) Start

func (m *Monitor) Start(ctx context.Context) error

func (*Monitor) Stop

func (m *Monitor) Stop() error

type Progress

type Progress struct {
	TaskId          string         `json:"taskId"`
	Name            string         `json:"name"`
	PercentComplete uint32         `json:"percentComplete"`
	Metadata        map[string]any `json:"metadata"`
	LastUpdatedAt   string         `json:"lastUpdatedAt"`
}

func ParseProgressFile

func ParseProgressFile(filePath string) (Progress, error)

Jump to

Keyboard shortcuts

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