stages

package
v0.0.0-...-11bfd58 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package stages allows interacting with Glazier build stages.

Index

Constants

View Source
const (
	// StartKey references the time that the stage started
	StartKey = "Start"
	// EndKey references the time that the stage ended
	EndKey = "End"
	// TermStage after which to consider the build completed
	TermStage = "100"
	// RegStagesRoot references the root Registry key under which stages exist
	RegStagesRoot = `SOFTWARE\Glazier\Stages`
)

Variables

View Source
var (
	// ErrPeriod indicates an unsupported period was passed when checking stage status
	ErrPeriod = errors.New("invalid period")
)

Functions

func ActiveStage

func ActiveStage() (uint64, error)

ActiveStage returns the active build stage string converted to uint64. The returned uint64 can be used for comparison against greater/lesser stages to determine the latest stage.

func SetStage

func SetStage(stageID string, period string) error

SetStage creates or updates the passed build stage in a database.

Types

type Stage

type Stage struct {
	ID    string
	Start time.Time
	End   time.Time
	State string
}

A Stage stores named stage elements.

func ActiveStatus

func ActiveStatus() (*Stage, error)

ActiveStatus returns a Stage struct with all known fields.

func NewStage

func NewStage() *Stage

NewStage fills the stage struct with default values.

func (*Stage) RetreiveTimes

func (s *Stage) RetreiveTimes(root, stageID string) error

RetreiveTimes populates the Stage struct with the start and end times of the passed stage ID.

Jump to

Keyboard shortcuts

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