Documentation
¶
Index ¶
- Variables
- func IsCompleted(p Progressable) bool
- func IsErrCompleted(err error) bool
- func Stream(ctx context.Context, progressable Progressable, interval time.Duration) <-chan Progress
- func StreamMonitor(ctx context.Context, monitor Monitorable, interval time.Duration) <-chan int64
- func StreamMonitors(ctx context.Context, monitors []Monitorable, interval time.Duration) <-chan []int64
- type AggregationStrategy
- type Aggregator
- type AtomicStage
- type Formatter
- type Generator
- type Manual
- func (p *Manual) Add(n int64)
- func (p *Manual) Current() int64
- func (p *Manual) Error() error
- func (p *Manual) Increment()
- func (p *Manual) Progress() Progress
- func (p *Manual) Set(n int64)
- func (p *Manual) SetCompleted()
- func (p *Manual) SetError(err error)
- func (p *Manual) SetTotal(total int64)
- func (p *Manual) Size() int64
- type Monitorable
- type Progress
- type Progressable
- type Progressor
- type Reader
- type Sizable
- type Stage
- type StagedMonitorable
- type StagedProgressable
- type StagedProgressor
- type Stager
- type TimeEstimator
- type TimedProgress
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCompleted = io.EOF
Functions ¶
func IsCompleted ¶
func IsCompleted(p Progressable) bool
func IsErrCompleted ¶
func StreamMonitor ¶
func StreamMonitors ¶
Types ¶
type AggregationStrategy ¶
type AggregationStrategy int
const ( DefaultStrategy AggregationStrategy = iota NormalizeStrategy )
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
func NewAggregator ¶
func NewAggregator(strategy AggregationStrategy, p ...Progressable) *Aggregator
func (*Aggregator) Add ¶
func (a *Aggregator) Add(p ...Progressable)
func (Aggregator) Current ¶
func (a Aggregator) Current() int64
func (Aggregator) Error ¶
func (a Aggregator) Error() error
func (*Aggregator) Progress ¶
func (a *Aggregator) Progress() Progress
func (Aggregator) Size ¶
func (a Aggregator) Size() int64
type AtomicStage ¶
type AtomicStage struct {
// contains filtered or unexported fields
}
func NewAtomicStage ¶
func NewAtomicStage(current string) *AtomicStage
func (*AtomicStage) Set ¶
func (s *AtomicStage) Set(new string)
func (*AtomicStage) Stage ¶
func (s *AtomicStage) Stage() string
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(monitor Monitorable, sizer Sizable) *Generator
type Manual ¶
type Manual struct {
// contains filtered or unexported fields
}
func (*Manual) SetCompleted ¶
func (p *Manual) SetCompleted()
type Monitorable ¶
type Progressable ¶
type Progressable interface { Monitorable Sizable }
type Progressor ¶
type Progressor interface {
Progress() Progress
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader should wrap another reader (acts as a bytes pass through)
func (*Reader) SetCompleted ¶
func (r *Reader) SetCompleted()
type StagedMonitorable ¶
type StagedMonitorable interface { Stager Monitorable }
type StagedProgressable ¶
type StagedProgressable interface { Stager Progressable }
type StagedProgressor ¶
type StagedProgressor interface { Stager Progressor }
type TimeEstimator ¶
type TimeEstimator struct {
// contains filtered or unexported fields
}
func NewTimeEstimator ¶
func NewTimeEstimator() TimeEstimator
func (*TimeEstimator) Estimated ¶
func (t *TimeEstimator) Estimated() time.Time
func (*TimeEstimator) Remaining ¶
func (t *TimeEstimator) Remaining() time.Duration
func (*TimeEstimator) Start ¶
func (t *TimeEstimator) Start()
func (*TimeEstimator) Update ¶
func (t *TimeEstimator) Update(p Progress)
type TimedProgress ¶
type TimedProgress struct {
// contains filtered or unexported fields
}
func NewTimedProgress ¶
func NewTimedProgress(duration time.Duration) *TimedProgress
func (*TimedProgress) Current ¶
func (r *TimedProgress) Current() int64
func (*TimedProgress) Error ¶
func (r *TimedProgress) Error() error
func (*TimedProgress) SetCompleted ¶
func (r *TimedProgress) SetCompleted()
func (*TimedProgress) Size ¶
func (r *TimedProgress) Size() int64
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer will consume a throw away bytes its given (not a passthrough). This is intended to be used with io.MultiWriter
func NewSizedWriter ¶
func (*Writer) SetComplete ¶
func (w *Writer) SetComplete()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.