package progress
import "github.com/containerd/containerd/v2/pkg/progress"
Package progress assists in displaying human readable progress information.
Index ¶
- type Bar
- type Bytes
- type BytesPerSecond
- func NewBytesPerSecond(n int64, duration time.Duration) BytesPerSecond
- func (bps BytesPerSecond) String() string
- type Writer
Types ¶
type Bar ¶
type Bar float64
Bar provides a very simple progress bar implementation.
Use with fmt.Printf and "r" to format the progress bar. A "-" flag makes it progress from right to left.
func (Bar) Format ¶
Format the progress bar as output
type Bytes ¶
type Bytes int64
Bytes converts a regular int64 to human readable type.
func (Bytes) String ¶
String returns the string representation of bytes
type BytesPerSecond ¶
type BytesPerSecond int64
BytesPerSecond is the rate in seconds for byte operations
func NewBytesPerSecond ¶
func NewBytesPerSecond(n int64, duration time.Duration) BytesPerSecond
NewBytesPerSecond returns the rate that n bytes were written in the provided duration
func (BytesPerSecond) String ¶
func (bps BytesPerSecond) String() string
String returns the string representation of the rate
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer buffers writes until flush, at which time the last screen is cleared and the current buffer contents are written. This is useful for implementing progress displays, such as those implemented in docker and git.
func NewWriter ¶
NewWriter returns a writer
func (*Writer) Flush ¶
Flush should be called when refreshing the current display.
func (*Writer) Write ¶
Write the provided bytes
Source Files ¶
bar.go doc.go escape.go humaans.go writer.go
- Version
- v2.0.4 (latest)
- Published
- Mar 17, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 1 month ago –
Tools for package owners.