http

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 5 Imported by: 0 modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientIP

func GetClientIP(req *http.Request) net.IP

GetClientIP extracts the client IP from the request, checking CF-Connecting-IP, X-Forwarded-For, and X-Real-Ip headers in that order.

Types

type Body

type Body struct {
	// contains filtered or unexported fields
}

Body wraps an io.ReadCloser with size-limited recording of the data read.

func NewBody

func NewBody(r io.ReadCloser, maxRecordSize int) *Body

NewBody creates a Body that reads from r and records up to maxRecordSize bytes.

func (*Body) Close

func (p *Body) Close() error

func (*Body) Content

func (p *Body) Content() []byte

Content returns the recorded content.

func (*Body) Length

func (p *Body) Length() int64

Length returns the total number of bytes read from the underlying reader.

func (*Body) Read

func (p *Body) Read(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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