gtui

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BarLength int    = 192
	BarTitle  string = "[Download| %s <%s/%sMB>]"
)

Variables

This section is empty.

Functions

func Blue

func Blue(v ...interface{})

func Cyan

func Cyan(v ...interface{})

func Gray

func Gray(v ...interface{})

func Green

func Green(v ...interface{})

func Magenta

func Magenta(v ...interface{})

func PrintError

func PrintError(v ...any)

func PrintErrorf added in v0.0.7

func PrintErrorf(format string, v ...any)

func PrintFatal

func PrintFatal(v ...any)

func PrintFatalf added in v0.0.8

func PrintFatalf(format string, v ...any)

func PrintInfo

func PrintInfo(v ...any)

func PrintInfof added in v0.0.7

func PrintInfof(format string, v ...any)

func PrintSuccess

func PrintSuccess(v ...any)

func PrintSuccessf added in v0.0.7

func PrintSuccessf(format string, v ...any)

func PrintWarning

func PrintWarning(v ...any)

func PrintWarningf added in v0.0.7

func PrintWarningf(format string, v ...any)

func White

func White(v ...interface{})

func Yellow

func Yellow(v ...interface{})

Types

type FadeColors

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

func NewFadeColors

func NewFadeColors(content any) *FadeColors

func (*FadeColors) Println

func (that *FadeColors) Println()

type HandleSelected added in v0.2.4

type HandleSelected func(string) string

type Input

type Input struct {
	Items []*InputItem
}

func NewInput

func NewInput(items []*InputItem) *Input

func (*Input) Render

func (that *Input) Render()

type InputItem

type InputItem struct {
	Title   string
	Value   string
	Default string
	Must    bool
}

func (*InputItem) Bool

func (that *InputItem) Bool() bool

func (*InputItem) Int

func (that *InputItem) Int() int

func (*InputItem) String

func (that *InputItem) String() string

type ProgressBar

type ProgressBar struct {
	Bar             *pterm.ProgressbarPrinter
	Filename        string
	ContentLength   int
	Total           string
	CurrentReceived int
	// contains filtered or unexported fields
}

ProgressBar for downloading files.

func NewProgressBar

func NewProgressBar(filename string, length int) (p *ProgressBar)

func (*ProgressBar) Start

func (that *ProgressBar) Start() (err error)

func (*ProgressBar) Write

func (that *ProgressBar) Write(p []byte) (n int, err error)

type Select added in v0.2.4

type Select struct {
	OptionList []string
	Handle     HandleSelected
}

func NewSelect added in v0.2.4

func NewSelect(opts []string, handle HandleSelected) *Select

func (*Select) SetDefaultText added in v0.2.5

func (that *Select) SetDefaultText(text string)

func (*Select) Start added in v0.2.4

func (that *Select) Start() string

Jump to

Keyboard shortcuts

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