ioutil

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBatchSize = 512

Variables

This section is empty.

Functions

func Batchify added in v1.8.1

func Batchify[T any](items []T, batchSize int) [][]T

Types

type LimitWriter added in v1.2.1

type LimitWriter struct {
	W io.Writer
	N int // bytes remaining that can be written
	D int // bytes dropped so far
}

LimitWriter is a writer that limits the number of bytes written to it.

func (*LimitWriter) Write added in v1.2.1

func (l *LimitWriter) Write(p []byte) (rnw int, err error)

type LinePrefixer added in v1.2.1

type LinePrefixer struct {
	W io.Writer

	Prefix []byte
	// contains filtered or unexported fields
}

LinePrefixer is a writer that prefixes each line written to it with a prefix.

func (*LinePrefixer) Close added in v1.2.1

func (l *LinePrefixer) Close() error

func (*LinePrefixer) Write added in v1.2.1

func (l *LinePrefixer) Write(p []byte) (n int, err error)

type SizeLimitedWriter added in v1.8.1

type SizeLimitedWriter struct {
	SizeTrackingWriter
	Limit uint64
}

func (*SizeLimitedWriter) Write added in v1.8.1

func (w *SizeLimitedWriter) Write(p []byte) (n int, err error)

type SizeTrackingWriter added in v1.6.0

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

func (*SizeTrackingWriter) Size added in v1.6.0

func (w *SizeTrackingWriter) Size() uint64

Size returns the number of bytes written to the writer. The value is fundamentally racy only consistent if synchronized with the writer or closed.

func (*SizeTrackingWriter) Write added in v1.6.0

func (w *SizeTrackingWriter) Write(p []byte) (n int, err error)

type SynchronizedWriter added in v1.0.0

type SynchronizedWriter struct {
	Mu sync.Mutex
	W  io.Writer
}

func (*SynchronizedWriter) Write added in v1.0.0

func (w *SynchronizedWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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