xprogress

package
v0.0.0-...-016edcc Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTicker

func NewTicker(ctx context.Context, u *Counter, d time.Duration) <-chan Progress

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter() *Counter

func (*Counter) AddN

func (u *Counter) AddN(n int64)

func (*Counter) N

func (u *Counter) N() int64

func (*Counter) SetN

func (u *Counter) SetN(n int64)

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

func (Progress) N

func (p Progress) N() int64

N gets the total number of bytes read or written so far.

type ReaderTap

type ReaderTap struct {
	// contains filtered or unexported fields
}

ReaderTap counts the bytes read through it.

func NewReaderTap

func NewReaderTap(r io.Reader, u *Counter) *ReaderTap

NewReaderTap makes a new ReaderTap that counts the bytes read through it.

func (*ReaderTap) Read

func (r *ReaderTap) Read(p []byte) (n int, err error)

type WriterTap

type WriterTap struct {
	// contains filtered or unexported fields
}

WriterTap counts the bytes read through it.

func NewWriterTap

func NewWriterTap(r io.Writer, u *Counter) *WriterTap

NewWriterTap makes a new WriterTap that counts the bytes read through it.

func (*WriterTap) Write

func (w *WriterTap) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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