xio

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: LGPL-2.1 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitReached = errors.New("i/o limit reached")

Functions

This section is empty.

Types

type BytesWriter

type BytesWriter struct {
	N     int
	Bytes []byte
}

BytesWriter will only write bytes to the underlying writer until the limit is reached.

func NewBytesWriter

func NewBytesWriter(bs []byte) *BytesWriter

func (*BytesWriter) Write

func (l *BytesWriter) Write(p []byte) (int, error)

type LimitWriter

type LimitWriter struct {
	Limit int
	N     int
	W     io.Writer
}

LimitWriter will only write bytes to the underlying writer until the limit is reached.

func NewLimitWriter

func NewLimitWriter(w io.Writer, n int) *LimitWriter

func (*LimitWriter) Write

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

Jump to

Keyboard shortcuts

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