seekable

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package seekable ... This package provide a method to read and replace http.Request's body.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBody = errors.New("no body")

ErrNoBody no request body

View Source
var ErrTooLargeBody = errors.New("too large body")

ErrTooLargeBody request too large

View Source
var MaxBodyLength int64 = 16 * 1024 * 1024

MaxBodyLength max body length

Functions

func ReadAll

func ReadAll(req *http.Request) (b []byte, err error)

ReadAll read all body

Types

type ReadCloser

type ReadCloser interface {
	Seekabler
	io.Closer
}

ReadCloser seekable closer

func New

func New(req *http.Request) (r ReadCloser, err error)

New new ReadCloser from http request

type Seekabler

type Seekabler interface {
	Bytes() []byte
	Read(val []byte) (n int, err error)
	SeekToBegin() error
}

Seekabler ...

Jump to

Keyboard shortcuts

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