xio

package
v0.0.0-...-8e6cb86 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloserContext

func CloserContext(c io.Closer, ctx context.Context) func()

func ContextCloser

func ContextCloser[C io.Closer](ctx context.Context, c C) func()

func Copy

func Copy(dst io.Writer, src io.Reader, f func(written int64)) (int64, error)

func CopyBuffer

func CopyBuffer(dst io.Writer, src io.Reader, buf []byte, f func(written int64)) (int64, error)

func MultiCloser

func MultiCloser(closers ...func() error) io.Closer

func ReadCloser

func ReadCloser(r io.Reader, c io.Closer) io.ReadCloser

Types

type Tracker

type Tracker struct {
	Written int64
	OnWrite func(written int64)
	OnRead  func(written int64)
}

func (*Tracker) Write

func (t *Tracker) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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