console

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bold

func Bold(txt string) string

Bold 控制台粗体字符

func BoxCodeItem

func BoxCodeItem(item string) string

BoxCodeItem creates a box line for code-like content.

func BoxDetailItem

func BoxDetailItem(item string) string

BoxDetailItem 创建box样式的详情条目

func BoxErrorFooter

func BoxErrorFooter() string

BoxErrorFooter 创建失败状态的底部

func BoxErrorItem

func BoxErrorItem(item string) string

BoxErrorItem 创建box样式的错误条目

func BoxHeader

func BoxHeader(icon, title string) string

BoxHeader 创建box样式的顶部标题

func BoxInfoItem

func BoxInfoItem(item string) string

BoxInfoItem creates a neutral informational box item.

func BoxItem

func BoxItem(item string) string

BoxItem 创建box样式的条目

func BoxSuccessFooter

func BoxSuccessFooter() string

BoxSuccessFooter 创建成功状态的底部

func CheckMark

func CheckMark() string

CheckMark 带颜色的对勾符号

func CrossMark

func CrossMark() string

CrossMark 带颜色的错误符号

func Cyan

func Cyan(txt string) string

Cyan 控制台青色字符

func DimCheckMark

func DimCheckMark() string

DimCheckMark 控制台淡色对勾符号

func DimCyan

func DimCyan(txt string) string

DimCyan 控制台淡青色字符

func DisplayJSONBox

func DisplayJSONBox(title string, payload []byte) error

DisplayJSONBox prints a formatted JSON box to stdout.

func Green

func Green(txt string) string

Green 控制台绿色字符

func IsRenderedError

func IsRenderedError(err error) bool

IsRenderedError reports whether the error has already been rendered.

func JSONBoxLines

func JSONBoxLines(title string, payload []byte) ([]string, error)

JSONBoxLines renders JSON content as box lines with light syntax highlighting.

func MarkRenderedError

func MarkRenderedError(err error) error

MarkRenderedError wraps an error so the root command won't print it again.

func NormalizeErrorLines

func NormalizeErrorLines(text string) []string

NormalizeErrorLines converts free-form error output into unique display lines.

func Red

func Red(txt string) string

Red 控制台红色字符

func Yellow

func Yellow(txt string) string

Yellow 控制台黄色字符

Types

type RenderedError

type RenderedError struct {
	Err error
}

RenderedError marks an error as already rendered in the console UI.

func (*RenderedError) Error

func (e *RenderedError) Error() string

func (*RenderedError) Unwrap

func (e *RenderedError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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