Documentation ¶
Overview ¶
Package utils contains command functionality which is reused across multiple other packages.
Index ¶
Constants ¶
const MaxAttempts = 3
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Progress ¶ added in v1.0.23
The Progress structure contains statistics about how many bytes have been read from the underlying reader.
type ProgressBar ¶ added in v1.0.23
The ProgressBar helps rendering a text-based progress indicator on the command-line. It uses the standard error output interface of the logger for writing progress.
func NewProgressBar ¶ added in v1.0.23
func NewProgressBar(logger log.Logger) *ProgressBar
func (*ProgressBar) Remove ¶ added in v1.0.23
func (b *ProgressBar) Remove()
type ProgressReader ¶ added in v1.0.23
type ProgressReader struct { io.Reader ProgressFunc func(progress Progress) // contains filtered or unexported fields }
The ProgressReader is a wrapper over the io.Reader interface which computes statistics while the data is read. This is used to show progress for file uploads and downloads.
The ProgressReader emits a Progress event whenever data is read from the reader. The event is debounced to avoid too many events.
func NewProgressReader ¶ added in v1.0.23
func NewProgressReader(reader io.Reader, progressFunc func(progress Progress)) *ProgressReader
type RetryableError ¶ added in v1.0.49
type RetryableError struct {
// contains filtered or unexported fields
}
RetryableError can be returned inside of the Retry() block to indicate that the function failed and should be retried.
func Retryable ¶ added in v1.0.49
func Retryable(err error) *RetryableError
func (RetryableError) Error ¶ added in v1.0.49
func (e RetryableError) Error() string