terminal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	Output() ([]byte, error)
	StdinPipe() (io.WriteCloser, error)
}

Cmd is an interface for exec.Cmd

type GetResourcesUpdate

type GetResourcesUpdate struct {
	Kind      string
	Resources int
}

type NewCommand

type NewCommand[C Cmd] func(name string, args ...string) C

type PBar

type PBar interface {
	Increment(int)
	SetTotalIncrements(int)
	SetWidth(int)
	String() string
}

type ProgressBar

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

func NewProgressBar

func NewProgressBar(termInfoQueryer TermInfoQueryer) *ProgressBar

func (*ProgressBar) Increment

func (p *ProgressBar) Increment(i int)

func (*ProgressBar) SetTotalIncrements

func (p *ProgressBar) SetTotalIncrements(increments int)

func (*ProgressBar) SetWidth

func (p *ProgressBar) SetWidth(width int)

func (*ProgressBar) String

func (p *ProgressBar) String() string

type Spinner

type Spinner struct {
	Tick <-chan time.Time
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner(tickInterval time.Duration) *Spinner

func (*Spinner) Spin

func (s *Spinner) Spin()

func (*Spinner) String

func (s *Spinner) String() string

type TPut

type TPut[C Cmd] struct {
	// contains filtered or unexported fields
}

func NewTPut

func NewTPut[C Cmd](newCommand NewCommand[C]) *TPut[C]

func (*TPut[C]) Query

func (t *TPut[C]) Query(capnames ...string) (string, error)

func (*TPut[C]) QueryInt

func (t *TPut[C]) QueryInt(capname string) (int, error)

type TermInfo

type TermInfo interface {
	Query(capname ...string) (string, error)
	QueryInt(capname string) (int, error)
}

type TermInfoQueryer

type TermInfoQueryer interface {
	Query(capnames ...string) (string, error)
}

type UI

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

func NewUI

func NewUI(progressBar PBar, spinner *Spinner, termInfo TermInfo, writer io.Writer) *UI

func (*UI) SetTotalKinds

func (u *UI) SetTotalKinds(count int) chan<- *GetResourcesUpdate

func (*UI) Start

func (u *UI) Start(ctx context.Context, wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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