events

package
v2.1.1 Latest Latest
Warning

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

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

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 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"`
}

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