ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithUI

func WithUI(ctx context.Context, u *UI) context.Context

WithUI adds the UI to the context

Types

type ColorMode

type ColorMode int

ColorMode defines how colors should be handled

const (
	ColorAuto ColorMode = iota
	ColorAlways
	ColorNever
)

type Options

type Options struct {
	Out       io.Writer
	Err       io.Writer
	ColorMode ColorMode
}

Options configures the UI

type UI

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

UI handles output and color support

func FromContext

func FromContext(ctx context.Context) *UI

FromContext retrieves the UI from the context

func New

func New(opts Options) *UI

New creates a new UI with the given options

func (*UI) Err

func (u *UI) Err() io.Writer

Err returns the stderr writer

func (*UI) Out

func (u *UI) Out() io.Writer

Out returns the stdout writer

func (*UI) Profile

func (u *UI) Profile() termenv.Profile

Profile returns the termenv profile for color support

Jump to

Keyboard shortcuts

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