Documentation
¶
Overview ¶
Package progressreader provides a Reader with a progress bar that can be printed out using the streamformatter package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
Broadcaster keeps track of one or more observers watching the progress of an operation. For example, if multiple clients are trying to pull an image, they share a Broadcaster for the download operation.
func NewBroadcaster ¶
func NewBroadcaster() *Broadcaster
NewBroadcaster returns a Broadcaster structure
func (*Broadcaster) Add ¶
func (broadcaster *Broadcaster) Add(w io.Writer) error
Add adds an observer to the Broadcaster. The new observer receives the data from the history buffer, and also all subsequent data.
func (*Broadcaster) Close ¶
func (broadcaster *Broadcaster) Close()
Close signals to all observers that the operation has finished.
func (*Broadcaster) Wait ¶
func (broadcaster *Broadcaster) Wait()
Wait blocks until the operation is marked as completed by the Done method.
type Config ¶
type Config struct {
In io.ReadCloser // Stream to read from
Out io.Writer // Where to send progress bar to
Formatter *streamformatter.StreamFormatter
Size int64
Current int64
LastUpdate int64
NewLines bool
ID string
Action string
}
Config contains the configuration for a Reader with progress bar.