events

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(ctx context.Context, haStdoutPath, haStderrPath string, begin time.Time, propagateStderr bool, onEvent func(Event) bool) error

Types

type CloudInitProgress

type CloudInitProgress struct {
	// Current log line from cloud-init
	LogLine string `json:"logLine,omitempty"`
	// Whether cloud-init has completed
	Completed bool `json:"completed,omitempty"`
	// Whether cloud-init monitoring is active
	Active bool `json:"active,omitempty"`
}

type Event

type Event struct {
	Time   time.Time `json:"time,omitempty"`
	Status Status    `json:"status,omitempty"`
}

type PortForwardEvent added in v2.1.0

type PortForwardEvent struct {
	Type      PortForwardEventType `json:"type"`
	Protocol  string               `json:"protocol,omitempty"`
	GuestAddr string               `json:"guestAddr,omitempty"`
	HostAddr  string               `json:"hostAddr,omitempty"`
	Error     string               `json:"error,omitempty"`
}

type PortForwardEventType added in v2.1.0

type PortForwardEventType string
const (
	PortForwardEventForwarding    PortForwardEventType = "forwarding"
	PortForwardEventNotForwarding PortForwardEventType = "not-forwarding"
	PortForwardEventStopping      PortForwardEventType = "stopping"
	PortForwardEventFailed        PortForwardEventType = "failed"
)

type RequirementProgress added in v2.3.0

type RequirementProgress struct {
	// Step is the 1-based index of this requirement across the unified
	// essential / optional / guest-agent / final groups.
	Step int `json:"step"`
	// Total is the total number of steps across all groups for this boot.
	Total int `json:"total"`
	// Description is the human-readable name of the requirement, already
	// capitalized for display.
	Description string `json:"description"`
	// Suffix is an optional trailing annotation shown only while the step
	// is pending (e.g. " (essential)").
	Suffix string `json:"suffix,omitempty"`
	// Done is true when the requirement has been satisfied. The first
	// event for each step is emitted with Done=false; the second with
	// Done=true, or Failed=true if the requirement could not be satisfied.
	Done bool `json:"done,omitempty"`
	// Failed is true when the requirement could not be satisfied.
	Failed bool `json:"failed,omitempty"`
}

RequirementProgress is emitted by the hostagent on every state transition of a startup-requirement check, so the limactl-side watcher can render progress with a TTY-aware in-place flip (🕐 -> ✅) when stderr is a terminal, and fall back to two log lines otherwise.

type Status

type Status struct {
	Running bool `json:"running,omitempty"`
	// When Degraded is true, Running must be true as well
	Degraded bool `json:"degraded,omitempty"`
	// When Exiting is true, Running must be false
	Exiting bool `json:"exiting,omitempty"`

	Errors []string `json:"errors,omitempty"`

	SSHLocalPort int `json:"sshLocalPort,omitempty"`

	// Cloud-init progress information
	CloudInitProgress *CloudInitProgress `json:"cloudInitProgress,omitempty"`

	// Port forwarding event
	PortForward *PortForwardEvent `json:"portForward,omitempty"`

	// Vsock forwarder event
	Vsock *VsockEvent `json:"vsock,omitempty"`

	// Requirement progress update — one event per state transition, see
	// RequirementProgress for fields.
	RequirementProgress *RequirementProgress `json:"requirementProgress,omitempty"`
}

type VsockEvent added in v2.1.0

type VsockEvent struct {
	Type      VsockEventType `json:"type"`
	HostAddr  string         `json:"hostAddr,omitempty"`
	VsockPort int            `json:"vsockPort,omitempty"`
	Reason    string         `json:"reason,omitempty"`
}

type VsockEventType added in v2.1.0

type VsockEventType string
const (
	VsockEventStarted VsockEventType = "started"
	VsockEventSkipped VsockEventType = "skipped"
	VsockEventFailed  VsockEventType = "failed"
)

Jump to

Keyboard shortcuts

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