progress

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT, Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Style  vaxis.Style
	Reader io.Reader
	Writer io.Writer

	Progress float64
	Total    float64
	// contains filtered or unexported fields
}

Model represents a progress bar. A progress bar is also an io.Reader and an io.Writer. If you pass it a DataMsg with a Total before calling Read or Write, it will pass through the R/W and display the progress

func New

func New(vx *vaxis.Vaxis) *Model

func (*Model) Draw

func (m *Model) Draw(win vaxis.Window)

func (*Model) Read

func (m *Model) Read(p []byte) (int, error)

Read counts the bytes read from Reader and sends the Model an updated progress message. The Total field should be set to an expected value for this to work properly

func (*Model) Write

func (m *Model) Write(p []byte) (int, error)

Write counts the bytes written to Writer and sends the Model an updated progress message. The Total field should be set to an expected value for this to work properly

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL