counter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	io.Reader
	// contains filtered or unexported fields
}

Counter is a counter for the number of bytes read from the reader

func NewCounter

func NewCounter(r io.Reader) *Counter

NewCounter function for create new Counter

func (*Counter) Count

func (c *Counter) Count() int64

Count count the number of bytes read from the reader

func (*Counter) Read

func (c *Counter) Read(buf []byte) (int, error)

Read implements io.Reader interface

func (*Counter) Tick

func (c *Counter) Tick(do func(int64), ticker *time.Ticker)

Tick ticker for progress consider to use ticker.Stop() to stop the ticker by yourself

Jump to

Keyboard shortcuts

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