http

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package http includes handlers and utilties

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAllAndReplaceBody

func ReadAllAndReplaceBody(r *http.Request) ([]byte, error)

ReadAllAndReplaceBody reads all of r.Body and replaces it with a new byte buffer.

Types

type MWMux added in v0.8.0

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

MWMux applies middleware when registering HTTP handlers.

func NewMWMux added in v0.8.0

func NewMWMux(mux Mux) *MWMux

NewMWMux creates a new MWMux using mux.

func (*MWMux) Handle added in v0.8.0

func (m *MWMux) Handle(pattern string, handler http.Handler)

Handle layers middlewares around handler and registers them with pattern.

func (*MWMux) HandleFunc added in v0.8.0

func (m *MWMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

HandleFunc layers middlewares around handler and registers them with pattern.

func (*MWMux) ServeHTTP added in v0.8.0

func (m *MWMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is a convenience wrapper to use m itself as an HTTP handler.

func (*MWMux) Use added in v0.8.0

func (m *MWMux) Use(middlewares ...func(http.Handler) http.Handler)

Use adds middlewares to be applied when registering HTTP handlers.

type Mux added in v0.8.0

type Mux interface {
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

Mux represents an HTTP muxer that can handle HTTP methods.

Directories

Path Synopsis
Package authproxy is a simple reverse proxy for Apple MDM clients.
Package authproxy is a simple reverse proxy for Apple MDM clients.

Jump to

Keyboard shortcuts

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