bytesutil

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrite = errors.New("failed to write")

Functions

func ParseByteSize added in v1.1.0

func ParseByteSize(size string) int64

func PrettyByteSize

func PrettyByteSize[V int64 | uint64 | uint32 | int](b V) string

Types

type WriterCounter

type WriterCounter struct {
	io.Writer
	// contains filtered or unexported fields
}

WriterCounter is counter for io.Writer.

func NewWriterCounter

func NewWriterCounter(w io.Writer) *WriterCounter

NewWriterCounter function create new WriterCounter.

func (*WriterCounter) Count

func (counter *WriterCounter) Count() uint64

Count function return counted bytes.

func (*WriterCounter) Write

func (counter *WriterCounter) Write(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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