package tui
import "github.com/docker/cli/internal/tui"
Index ¶
- Variables
- func Chip(fg, bg int, content string) string
- func Ellipsis(s string, length int) string
- func Width(s string) int
- type Output
- func NewOutput(out *streams.Out) Output
- func (o Output) Color(clr aec.ANSI) aec.ANSI
- func (o Output) Print(p ...any)
- func (o Output) PrintNote(format string, args ...any)
- func (o Output) Println(p ...any)
- func (o Output) PrintlnWithColor(clr aec.ANSI, args ...any)
- func (o Output) Sprint(all ...any) string
- type Str
Variables ¶
var ( ColorTitle = aec.NewBuilder(aec.DefaultF, aec.Bold).ANSI ColorPrimary = aec.NewBuilder(aec.DefaultF, aec.Bold).ANSI ColorSecondary = aec.DefaultF ColorTertiary = aec.NewBuilder(aec.DefaultF, aec.Faint).ANSI ColorLink = aec.NewBuilder(aec.LightCyanF, aec.Underline).ANSI ColorWarning = aec.LightYellowF ColorFlag = aec.NewBuilder(aec.Bold).ANSI ColorNone = aec.ANSI(noColor{}) )
var InfoHeader = Str{ Plain: " Info -> ", Fancy: aec.Bold.Apply(aec.LightCyanB.Apply(aec.BlackF.Apply("i")) + " " + aec.LightCyanF.Apply("Info → ")), }
Functions ¶
func Chip ¶
func Ellipsis ¶
Ellipsis truncates a string to a given number of runes with an ellipsis at the end. It tries to persist the ANSI escape sequences.
func Width ¶
Width returns the width of the string, ignoring ANSI escape codes. Not all ANSI escape codes are supported yet.
Types ¶
type Output ¶
func NewOutput ¶
func (Output) Color ¶
func (Output) Print ¶
func (Output) PrintNote ¶
func (Output) Println ¶
func (Output) PrintlnWithColor ¶
func (Output) Sprint ¶
type Str ¶
type Str struct { // Fancy is the fancy string representation of the string. Fancy string // Plain is the plain string representation of the string. Plain string }
func (Str) String ¶
Source Files ¶
chip.go colors.go count.go note.go output.go str.go
- Version
- v28.1.1+incompatible (latest)
- Published
- Apr 18, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 4 hours ago –
Tools for package owners.