docker: github.com/docker/docker/pkg/progress Index | Files

package progress

import "github.com/docker/docker/pkg/progress"

Index

Package Files

progress.go progressreader.go

func Aux Uses

func Aux(out Output, a interface{})

Aux sends auxiliary information over a progress interface, which will not be formatted for the UI. This is used for things such as push signing.

func Message Uses

func Message(out Output, id, message string)

Message is a convenience function to write a progress message to the channel.

func Messagef Uses

func Messagef(out Output, id, format string, a ...interface{})

Messagef is a convenience function to write a printf-formatted progress message to the channel.

func Update Uses

func Update(out Output, id, action string)

Update is a convenience function to write a progress update to the channel.

func Updatef Uses

func Updatef(out Output, id, format string, a ...interface{})

Updatef is a convenience function to write a printf-formatted progress update to the channel.

type Output Uses

type Output interface {
    WriteProgress(Progress) error
}

Output is an interface for writing progress information. It's like a writer for progress, but we don't call it Writer because that would be confusing next to ProgressReader (also, because it doesn't implement the io.Writer interface).

func ChanOutput Uses

func ChanOutput(progressChan chan<- Progress) Output

ChanOutput returns an Output that writes progress updates to the supplied channel.

func DiscardOutput Uses

func DiscardOutput() Output

DiscardOutput returns an Output that discards progress

type Progress Uses

type Progress struct {
    ID  string

    // Progress contains a Message or...
    Message string

    // ...progress of an action
    Action  string
    Current int64
    Total   int64

    // If true, don't show xB/yB
    HideCounts bool
    // If not empty, use units instead of bytes for counts
    Units string

    // Aux contains extra information not presented to the user, such as
    // digests for push signing.
    Aux interface{}

    LastUpdate bool
}

Progress represents the progress of a transfer.

type Reader Uses

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

Reader is a Reader with progress bar.

func NewProgressReader Uses

func NewProgressReader(in io.ReadCloser, out Output, size int64, id, action string) *Reader

NewProgressReader creates a new ProgressReader.

func (*Reader) Close Uses

func (p *Reader) Close() error

Close closes the progress reader and its underlying reader.

func (*Reader) Read Uses

func (p *Reader) Read(buf []byte) (n int, err error)

Package progress imports 4 packages (graph) and is imported by 3483 packages. Updated 2019-12-16. Refresh now. Tools for package owners.