view

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package view provides a small, consistent output helper for interactive CLI flows (Success / Error / Info / Printf / Println). Color is via lipgloss and honors NO_COLOR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type View

type View struct {
	Out io.Writer
	Err io.Writer
	// contains filtered or unexported fields
}

View writes status messages to stdout/stderr with optional color.

func New

func New() *View

New returns a View writing to os.Stdout / os.Stderr.

func NewWithWriters

func NewWithWriters(out, err io.Writer) *View

NewWithWriters returns a View writing to the provided writers.

func (*View) Error

func (v *View) Error(format string, args ...any)

Error writes a red-prefixed line to stderr.

func (*View) Info

func (v *View) Info(format string, args ...any)

Info writes a dim-prefixed line to stdout.

func (*View) Printf

func (v *View) Printf(format string, args ...any)

Printf writes a formatted line to stdout (no prefix, no automatic newline).

func (*View) Println

func (v *View) Println(s string)

Println writes the string to stdout followed by a newline.

func (*View) Success

func (v *View) Success(format string, args ...any)

Success writes a green-prefixed line to stdout.

Jump to

Keyboard shortcuts

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