jobs

package
v0.0.0-...-e3315c2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSentinel

func ExtractSentinel(line string) (string, int, int, bool)

func ParseSentinel

func ParseSentinel(line string) (int, int, bool)

func SentinelFor

func SentinelFor(jobID int) string

Types

type HostState

type HostState string
const (
	HostQueued  HostState = "queued"
	HostRunning HostState = "running"
	HostSuccess HostState = "succeeded"
	HostFailed  HostState = "failed"
)

type HostStatus

type HostStatus struct {
	Host     string
	State    HostState
	ExitCode int
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*HostStatus) Elapsed

func (h *HostStatus) Elapsed() time.Duration

type Job

type Job struct {
	ID         int
	Type       JobType
	Command    string
	Created    time.Time
	Hosts      map[string]*HostStatus
	HostsOrder []string
}

type JobType

type JobType string
const (
	JobTypeNormal JobType = "normal"
	JobTypeAsync  JobType = "async"
)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) AsyncJobs

func (m *Manager) AsyncJobs() []*Job

func (*Manager) CreateJob

func (m *Manager) CreateJob(t JobType, command string, hosts []string) *Job

func (*Manager) Job

func (m *Manager) Job(jobID int) *Job

func (*Manager) MarkHostDone

func (m *Manager) MarkHostDone(jobID int, host string, exitCode int, success bool)

func (*Manager) MarkHostRunning

func (m *Manager) MarkHostRunning(jobID int, host string)

func (*Manager) NormalJobs

func (m *Manager) NormalJobs() []*Job

Jump to

Keyboard shortcuts

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