Documentation
¶
Overview ¶
Package input gives each handler of an input its own section of it, which it can read independently and concurrently, and seek in, copying an input which can't be read at an offset, such as a pipe, to a temporary file
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTooLarge = errors.New("input is too large")
ErrTooLarge is returned when the input is larger than its maximum size
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input gives content type detection, and each handler, its own section of the input, which it can read independently and concurrently, and seek in. When the input can't be read at an offset and seeked, such as a pipe, it's copied to a temporary file first, which is removed when the input is closed, so it's never read into memory as a whole.
func New ¶
New returns the input of r, from its current position, which is at most maxSize bytes, when maxSize is greater than zero. If r carries a name, it's preserved on each section, since detection uses its extension, and a handler may need the filename itself (e.g. to look up TMDB metadata) rather than the file's contents. The input must be closed.