diskio

package
v1.19.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MeteredReader

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

func NewMeteredReader

func NewMeteredReader(r io.Reader, cb MeteredReaderCallback) *MeteredReader

func (*MeteredReader) Read

func (m *MeteredReader) Read(p []byte) (n int, err error)

Read passes the read through to the underlying reader. On a successful read, it will trigger the attached callback and provide it with metrics. If no callback is set, it will ignore it.

type MeteredReaderCallback

type MeteredReaderCallback func(read int64, nanoseconds int64)

Jump to

Keyboard shortcuts

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