ioutil

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Unlicense Imports: 3 Imported by: 3

Documentation

Overview

Package ioutil contains extensions and utilities for package io from the standard library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitReader

func LimitReader(r io.Reader, n uint64) (limited io.Reader)

LimitReader returns an io.Reader that reads up to n bytes. Once that limit is reached, [ErrLimit] is returned from limited.Read. limited.Read is not safe for concurrent use. n must be non-negative.

Types

type LimitError

type LimitError struct {
	// Limit is the limit that triggered the error.
	Limit uint64
}

LimitError is returned when the Limit is reached.

func (*LimitError) Error

func (err *LimitError) Error() (msg string)

Error implements the error interface for *LimitError.

Jump to

Keyboard shortcuts

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