cui

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cui defines charcter user interfaces for I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*basicUI)

Option represents an option for New.

func ErrWriter

func ErrWriter(ew io.Writer) Option

ErrWriter modifies the default error writer to w.

func Writer

func Writer(w io.Writer) Option

Writer modifies the default writer to w.

type UI

type UI interface {
	Output(s string)
	Info(s string)
	Warn(s string)
	Error(s string)

	Writer() io.Writer
}

UI provides formatted I/O interfaces. It is used from Evans's standard I/O and CLI mode I/O.

func New

func New(opts ...Option) UI

New creates a new UI with passed options.

func NewColored

func NewColored(ui UI) UI

NewColored wraps provided `ui` with coloredUI. If `ui` is *coloredUI, NewColored returns it as it is. Colored output works fine in Windows environment.

Jump to

Keyboard shortcuts

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