iohelpers

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package iohelpers provides basic extensions to the helpers provided by the Go stdlib "io" module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountingReader

type CountingReader struct {
	R io.Reader // underlying reader
	N int64     // number of bytes read
}

CountingReader is an io.Reader wrapper that counts how many bytes were read from the underlying io.Reader.

func CountReader

func CountReader(rdr io.Reader) *CountingReader

CountReader returns a new *CountingReader that wraps the given io.Reader.

func (CountingReader) BytesRead

func (c CountingReader) BytesRead() int64

BytesRead returns the number of bytes read so far from the reader. This is just shorthand for c.N.

func (*CountingReader) Read

func (c *CountingReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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