ui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: EUPL-1.2 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var QuotesJSON embed.FS

Functions

func GetPWAQuote

func GetPWAQuote() (string, error)

func GetRandomQuote

func GetRandomQuote() (string, error)

func GetVCSQuote

func GetVCSQuote() (string, error)

func GetWebsiteQuote

func GetWebsiteQuote() (string, error)

func IsTTY added in v0.3.0

func IsTTY(fd uintptr) bool

IsTTY returns true if the given file descriptor is a terminal.

func NewProgressBar

func NewProgressBar(total int, description string) *progressbar.ProgressBar

NewProgressBar creates a new progress bar with the specified total and description.

func NewProgressWriter

func NewProgressWriter(bar *progressbar.ProgressBar) *progressWriter

func PrintQuote

func PrintQuote()

Types

type InteractiveProgress added in v0.3.0

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

InteractiveProgress uses simple terminal output for TTY sessions.

func NewInteractiveProgress added in v0.3.0

func NewInteractiveProgress(w io.Writer) *InteractiveProgress

func (*InteractiveProgress) Finish added in v0.3.0

func (p *InteractiveProgress) Finish(label string)

func (*InteractiveProgress) Log added in v0.3.0

func (p *InteractiveProgress) Log(level, msg string, args ...any)

func (*InteractiveProgress) Start added in v0.3.0

func (p *InteractiveProgress) Start(label string)

func (*InteractiveProgress) Update added in v0.3.0

func (p *InteractiveProgress) Update(current, total int64)

type NonInteractivePrompter

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

func NewNonInteractivePrompter

func NewNonInteractivePrompter(quoteFunc func() (string, error)) *NonInteractivePrompter

func (*NonInteractivePrompter) IsInteractive

func (p *NonInteractivePrompter) IsInteractive() bool

func (*NonInteractivePrompter) Start

func (p *NonInteractivePrompter) Start()

func (*NonInteractivePrompter) Stop

func (p *NonInteractivePrompter) Stop()

type Progress added in v0.3.0

type Progress interface {
	Start(label string)
	Update(current, total int64)
	Finish(label string)
	Log(level, msg string, args ...any)
}

Progress abstracts output for both interactive and scripted use.

func DefaultProgress added in v0.3.0

func DefaultProgress() Progress

DefaultProgress returns InteractiveProgress for TTYs, QuietProgress otherwise.

type QuietProgress added in v0.3.0

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

QuietProgress writes structured log lines. For cron, pipes, --quiet.

func NewQuietProgress added in v0.3.0

func NewQuietProgress(w io.Writer) *QuietProgress

func (*QuietProgress) Finish added in v0.3.0

func (q *QuietProgress) Finish(label string)

func (*QuietProgress) Log added in v0.3.0

func (q *QuietProgress) Log(level, msg string, args ...any)

func (*QuietProgress) Start added in v0.3.0

func (q *QuietProgress) Start(label string)

func (*QuietProgress) Update added in v0.3.0

func (q *QuietProgress) Update(current, total int64)

type Quotes

type Quotes struct {
	InitWorkAssimilate        []string `json:"init_work_assimilate"`
	EncryptionServiceMessages []string `json:"encryption_service_messages"`
	CodeRelatedShort          []string `json:"code_related_short"`
	VCSProcessing             []string `json:"vcs_processing"`
	PWAProcessing             []string `json:"pwa_processing"`
	CodeRelatedLong           []string `json:"code_related_long"`
	ImageRelated              struct {
		PNG  string `json:"png"`
		JPG  string `json:"jpg"`
		SVG  string `json:"svg"`
		WEBP string `json:"webp"`
		HEIC string `json:"heic"`
		RAW  string `json:"raw"`
		ICO  string `json:"ico"`
		AVIF string `json:"avif"`
		TIFF string `json:"tiff"`
		GIF  string `json:"gif"`
	} `json:"image_related"`
}

Jump to

Keyboard shortcuts

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