luci: go.chromium.org/luci/client/internal/progress Index | Files

package progress

import "go.chromium.org/luci/client/internal/progress"

Package progress implements a progress indicator for text mode applications.

Index

Package Files

doc.go progress.go

type Column Uses

type Column struct {
    Name      string
    Formatter Formatter
    Value     int64
}

Column represent a column to be printed in the progress status.

type Formatter Uses

type Formatter func(i int64) string

Formatter formats numbers in a Column.

type Group Uses

type Group int

Group identifies a column group to keep progress for.

type Progress Uses

type Progress interface {
    io.Closer
    // Update increases the count of a column.
    Update(group Group, section Section, count int64)
}

Progress outputs information about the progress of a long task.

It's implementation must be thread safe.

func New Uses

func New(columns [][]Column, out io.Writer) Progress

New returns an initialized thread-safe Progress implementation.

columns is the number of stages each item must go through, then with a set of numbers for each state, which will be displayed as a number in each box.

For:

columns = [][]Column{{Name:"found"}, {"hashed", Name:"to hash"}}

It'll print:

[found] [hashed/to hash]

type Section Uses

type Section int

Section identifies a particular column in a column group.

Package progress imports 9 packages (graph) and is imported by 2 packages. Updated 2018-12-19. Refresh now. Tools for package owners.