runtimepresentation

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEnvironmentURL

func BuildEnvironmentURL(controlplaneBaseURL string, envPublicID string) string

Types

type BrandMark

type BrandMark struct {
	Size       BrandMarkSize
	Lines      []string
	MinWidth   int
	MinHeight  int
	ANSIAccent bool
}

func CompactBrandMark

func CompactBrandMark() BrandMark

func CompactBrandMarkFrame

func CompactBrandMarkFrame(frame int) BrandMark

func TinyBrandMark

func TinyBrandMark() BrandMark

type BrandMarkSize

type BrandMarkSize string
const (
	BrandMarkCompact BrandMarkSize = "compact"
	BrandMarkTiny    BrandMarkSize = "tiny"
)

type Config

type Config struct {
	Requested   Mode
	Effective   Mode
	Color       bool
	Dynamic     bool
	Interactive bool
}

func ResolveConfig

func ResolveConfig(requested Mode, in ResolveInput) Config

type ControlPlaneSetup

type ControlPlaneSetup struct {
	ControlplaneURL string
	EnvironmentID   string
	BootstrapTicket string
}

type ControlPlaneStatus

type ControlPlaneStatus struct {
	Enabled        bool
	Connected      bool
	Connectable    bool
	Label          string
	ActionLabel    string
	DisabledReason string
}

type Controller

type Controller interface {
	ConnectControlPlane(ctx context.Context) error
	DisconnectControlPlane(ctx context.Context) error
	ConfigureControlPlane(ctx context.Context, setup ControlPlaneSetup) (ControlPlaneStatus, error)
	ControlPlaneStatus() ControlPlaneStatus
	RuntimeOverview() RuntimeOverview
	RuntimeSessions() []RuntimeSession
}

type Event

type Event struct {
	Kind        EventKind
	Phase       Phase
	Title       string
	Detail      string
	Snapshot    Snapshot
	ErrorCode   string
	ErrorDetail string
	Severity    Severity
	Remediation string
	At          time.Time
}

type EventKind

type EventKind string
const (
	EventPhaseStarted EventKind = "phase_started"
	EventPhaseDone    EventKind = "phase_done"
	EventInfo         EventKind = "info"
	EventWarning      EventKind = "warning"
	EventFailure      EventKind = "failure"
	EventReady        EventKind = "ready"
)

type HostInfo

type HostInfo struct {
	Hostname string
	GOOS     string
	GOARCH   string
	PID      int
}

func DetectHostInfo

func DetectHostInfo() HostInfo

type LogBuffer

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

func NewLogBuffer

func NewLogBuffer(maxLines int) *LogBuffer

func (*LogBuffer) Lines

func (b *LogBuffer) Lines(limit int) []LogLine

func (*LogBuffer) Write

func (b *LogBuffer) Write(p []byte) (int, error)

type LogLine

type LogLine struct {
	Seq     uint64
	At      time.Time
	Level   string
	Message string
	Raw     string
}

type Mode

type Mode string
const (
	ModeAuto    Mode = "auto"
	ModeRich    Mode = "rich"
	ModePlain   Mode = "plain"
	ModeMachine Mode = "machine"
)

func ParseMode

func ParseMode(raw string) (Mode, error)

type Phase

type Phase string
const (
	PhaseResolveState   Phase = "resolve_state"
	PhaseAcquireLock    Phase = "acquire_lock"
	PhaseLoadConfig     Phase = "load_config"
	PhaseBootstrap      Phase = "bootstrap"
	PhaseStartServices  Phase = "start_services"
	PhaseStartLocalUI   Phase = "start_local_ui"
	PhaseConnectControl Phase = "connect_control"
	PhaseReady          Phase = "ready"
	PhaseShutdown       Phase = "shutdown"
)

type Recorder

type Recorder struct {
	Started []Snapshot
	Events  []Event
	Results []Result
}

func (*Recorder) Close

func (r *Recorder) Close(result Result) error

func (*Recorder) Emit

func (r *Recorder) Emit(event Event) error

func (*Recorder) Start

func (r *Recorder) Start(snapshot Snapshot) error

type Renderer

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

func NewRenderer

func NewRenderer(w io.Writer, cfg Config) *Renderer

func NewRendererWithOptions

func NewRendererWithOptions(w io.Writer, cfg Config, opts RendererOptions) *Renderer

func (*Renderer) Close

func (r *Renderer) Close(result Result) error

func (*Renderer) Emit

func (r *Renderer) Emit(event Event) error

func (*Renderer) SetController

func (r *Renderer) SetController(controller Controller)

func (*Renderer) Start

func (r *Renderer) Start(snapshot Snapshot) error

type RendererOptions

type RendererOptions struct {
	Input          io.Reader
	Logs           *LogBuffer
	Controller     Controller
	StartedAt      time.Time
	TerminalWidth  int
	TerminalHeight int
}

type Reporter

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

func NewReporter

func NewReporter(snapshot Snapshot, sinks ...Sink) *Reporter

func (*Reporter) Close

func (r *Reporter) Close(result Result) error

func (*Reporter) Emit

func (r *Reporter) Emit(event Event) error

func (*Reporter) Snapshot

func (r *Reporter) Snapshot() Snapshot

func (*Reporter) Start

func (r *Reporter) Start() error

func (*Reporter) UpdateSnapshot

func (r *Reporter) UpdateSnapshot(update func(*Snapshot))

type ResolveInput

type ResolveInput struct {
	Stdin             io.Reader
	Stdout            io.Writer
	Stderr            io.Writer
	Env               map[string]string
	DesktopManaged    bool
	StartupReportFile string
}

type Result

type Result struct {
	Success  bool
	Snapshot Snapshot
	Error    error
}

type RichFocus

type RichFocus string
const (
	RichFocusControlPlane RichFocus = "control_plane"
	RichFocusSessions     RichFocus = "sessions"
	RichFocusLogs         RichFocus = "logs"
)

type RichPanel

type RichPanel string
const (
	RichPanelNone         RichPanel = ""
	RichPanelLogs         RichPanel = "logs"
	RichPanelSessions     RichPanel = "sessions"
	RichPanelControlPlane RichPanel = "control_plane"
)

type RuntimeOverview

type RuntimeOverview struct {
	Version                 string
	Commit                  string
	BuildTime               string
	ProtocolVersion         string
	Compatibility           string
	CompatibilityMessage    string
	MinimumDesktopVersion   string
	MinimumRuntimeVersion   string
	ServiceOwner            string
	DesktopManaged          bool
	EffectiveRunMode        string
	RemoteEnabled           bool
	OpenReadinessState      string
	OpenReadinessReasonCode string
	OpenReadinessMessage    string
	Workload                RuntimeWorkload
	ProviderLink            RuntimeProviderLink
}
type RuntimeProviderLink struct {
	State                    string
	ProviderOrigin           string
	ProviderID               string
	EnvPublicID              string
	LocalEnvironmentPublicID string
	RemoteEnabled            bool
	LastErrorCode            string
	LastErrorMessage         string
}

type RuntimeSession

type RuntimeSession struct {
	ChannelID         string
	UserPublicID      string
	UserEmail         string
	FloeApp           string
	AppLabel          string
	CodeSpaceID       string
	SessionKind       string
	TunnelURL         string
	CreatedAtUnixMs   int64
	ConnectedAtUnixMs int64
	CanRead           bool
	CanWrite          bool
	CanExecute        bool
}

type RuntimeWorkload

type RuntimeWorkload struct {
	ActiveSessions      int
	AgentSessions       int
	CodeSessions        int
	PortForwardSessions int
	TerminalSessions    int
	ActiveTasks         int
}

type Severity

type Severity string
const (
	SeverityInfo     Severity = "info"
	SeverityWarning  Severity = "warning"
	SeverityError    Severity = "error"
	SeverityCritical Severity = "critical"
)

type Sink

type Sink interface {
	Start(snapshot Snapshot) error
	Emit(event Event) error
	Close(result Result) error
}

type Snapshot

type Snapshot struct {
	Version                  string
	Commit                   string
	RequestedRunMode         string
	EffectiveRunMode         string
	PresentationMode         string
	DesktopManaged           bool
	RemoteEnabled            bool
	ControlChannelEnabled    bool
	LocalUIEnabled           bool
	ControlplaneBaseURL      string
	ControlplaneProviderID   string
	EnvPublicID              string
	StateDir                 string
	LocalUIBind              string
	LocalUIURLs              []string
	EnvironmentURL           string
	RuntimeControlSocketPath string
}

Jump to

Keyboard shortcuts

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