Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProgressBytes = ProgressType("bytes") ProgressDuration = ProgressType("duration") ProgressGauge = ProgressType("gauge") )
ProgressType values.
Variables ¶
This section is empty.
Functions ¶
func DefaultStatus ¶
func DefaultStatus(s ProgressStatus) string
DefaultStatus renders ProgressStatus as a string.
func MetricsStatus ¶
func MetricsStatus(s ProgressStatus) string
MetricsStatus renders ProgressStatus metrics as a string.
Types ¶
type CountingReader ¶
CountingReader wraps io.Reader to count bytes.
func (*CountingReader) Bytes ¶
func (cr *CountingReader) Bytes() int64
Bytes returns number of read bytes.
func (*CountingReader) Lines ¶
func (cr *CountingReader) Lines() int64
Lines returns number of read lines.
type CountingWriter ¶
CountingWriter wraps io.Writer to count bytes.
func (*CountingWriter) Bytes ¶
func (cr *CountingWriter) Bytes() int64
Bytes returns number of written bytes.
func (*CountingWriter) Lines ¶
func (cr *CountingWriter) Lines() int64
Lines returns number of written bytes.
type MetricsExposer ¶
type MetricsExposer interface {
Metrics() []ProgressMetric
}
MetricsExposer provides metric counters.
type Progress ¶
type Progress struct {
Interval time.Duration
Print func(status ProgressStatus)
ShowHeapStats bool
ShowLinesStats bool
// contains filtered or unexported fields
}
Progress reports reading performance.
func (*Progress) AddMetrics ¶
func (p *Progress) AddMetrics(metrics ...ProgressMetric)
AddMetrics adds more metrics to progress status message.
type ProgressMetric ¶
type ProgressMetric struct {
Name string
Type ProgressType
Value *int64
}
ProgressMetric is an operation metric.
Click to show internal directories.
Click to hide internal directories.