progress

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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