apiutil

package
v0.85.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apiutil provides utility functions for the API.

Package apiutil provides utility functions for the API.

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitedReaderLimitReached = errors.New("read limit reached")

ErrLimitedReaderLimitReached indicates that the read limit has been reached.

Functions

func SetupCoverageHandler added in v0.69.0

func SetupCoverageHandler(_ *http.ServeMux)

SetupCoverageHandler does nothing when compiling without the e2ecoverage build tag

Types

type LimitedReader

type LimitedReader struct {
	Count int64
	// contains filtered or unexported fields
}

LimitedReader reads from a reader up to a specific limit. When this limit has been reached, any subsequent read will return ErrLimitedReaderLimitReached. The underlying reader has to implement io.ReadCloser so that it can be used with http request bodies.

func NewLimitedReader

func NewLimitedReader(r io.ReadCloser, limit int64) *LimitedReader

NewLimitedReader creates a new LimitedReader.

func (*LimitedReader) Close

func (r *LimitedReader) Close() error

Close closes the underlying reader.

func (*LimitedReader) Read

func (r *LimitedReader) Read(buf []byte) (n int, err error)

Read reads from the underlying reader.

Jump to

Keyboard shortcuts

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