reporter

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshInterval = 100 * time.Millisecond
)

Variables

View Source
var (
	StatusDockerPush = &Status{
		Text:      "pushing image",
		TextWidth: 13,
		Priority:  1,
	}
	StatusDockerPull = &Status{
		Text:      "pulling image",
		TextWidth: 13,
		Priority:  1,
	}
	StatusWaiting = &Status{
		TextWidth: 7,
		Text:      "waiting",
		Priority:  0,
	}
	StatusRunning = &Status{
		Text:      "running ⭐️",
		TextWidth: 10,
		Priority:  2,
	}
	StatusReady = &Status{
		Text:      "ready ⭐️",
		TextWidth: 8,
		Priority:  3,
	}
)

Functions

func GetTerminalSize

func GetTerminalSize(w io.Writer) (width, height int, err error)

func IsTerminal

func IsTerminal(w io.Writer) bool

Types

type ProgressTask

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

func (*ProgressTask) Done

func (pt *ProgressTask) Done()

func (*ProgressTask) Name

func (pt *ProgressTask) Name() string

func (*ProgressTask) Update

func (pt *ProgressTask) Update(v float64)

type Reporter

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

func New

func New(out io.Writer) *Reporter

func (*Reporter) AddRow

func (r *Reporter) AddRow(name string) *Row

func (*Reporter) DeleteRow

func (r *Reporter) DeleteRow(row *Row)

func (*Reporter) IsTerminal

func (r *Reporter) IsTerminal() bool

func (*Reporter) LogErrorSink

func (r *Reporter) LogErrorSink() io.Writer

func (*Reporter) LogSink

func (r *Reporter) LogSink() io.Writer

func (*Reporter) Refresh

func (r *Reporter) Refresh()

type Row

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

func (*Row) AddProgressTask

func (row *Row) AddProgressTask(name string) *ProgressTask

func (*Row) AddStatus

func (row *Row) AddStatus(s *Status)

func (*Row) Name

func (row *Row) Name() string

func (*Row) RemoveStatus

func (row *Row) RemoveStatus(s *Status) bool

type Status

type Status struct {
	Priority  int
	Text      string
	TextWidth int
}

Jump to

Keyboard shortcuts

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