output

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit[E Event](sink Sink, event E)

Emit sends an event to the sink with compile-time type safety via generics.

func EmitContainerLogLine

func EmitContainerLogLine(sink Sink, line string)

func EmitLog

func EmitLog(sink Sink, message string)

func EmitProgress

func EmitProgress(sink Sink, container, layerID, status string, current, total int64)

func EmitStatus

func EmitStatus(sink Sink, phase, container, detail string)

func EmitUserInputRequest

func EmitUserInputRequest(sink Sink, event UserInputRequestEvent)

func EmitWarning

func EmitWarning(sink Sink, message string)

func FormatEventLine

func FormatEventLine(event any) (string, bool)

FormatEventLine converts an output event into a single display line.

Types

type ContainerLogLineEvent

type ContainerLogLineEvent struct {
	Line string
}

type ContainerStatusEvent

type ContainerStatusEvent struct {
	Phase     string // e.g., "pulling", "starting", "waiting", "ready"
	Container string
	Detail    string // optional extra info (e.g., container ID)
}

type InputOption

type InputOption struct {
	Key   string
	Label string
}

type InputResponse

type InputResponse struct {
	SelectedKey string
	Cancelled   bool
}

type LogEvent

type LogEvent struct {
	Message string
}

type PlainSink

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

func NewPlainSink

func NewPlainSink(out io.Writer) *PlainSink

func (*PlainSink) Err

func (s *PlainSink) Err() error

Err returns the first write error encountered, if any.

type ProgressEvent

type ProgressEvent struct {
	Container string
	LayerID   string
	Status    string
	Current   int64
	Total     int64
}

type Sender

type Sender interface {
	Send(msg any)
}

Sender abstracts Bubble Tea's Program.Send to keep TUISink decoupled and testable.

type Sink

type Sink interface {
	// contains filtered or unexported methods
}

type SinkFunc

type SinkFunc func(event any)

type TUISink

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

func NewTUISink

func NewTUISink(sender Sender) *TUISink

type UserInputRequestEvent

type UserInputRequestEvent struct {
	Prompt     string
	Options    []InputOption
	ResponseCh chan<- InputResponse
}

type WarningEvent

type WarningEvent struct {
	Message string
}

Jump to

Keyboard shortcuts

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