httptools

package
v0.0.0-...-f33fafb Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternal = &errors.RichError{Name: "internal", Code: 500, Desc: "An internal server error has occurred."}
View Source
var Logger = log.Default()

Functions

func ServeError

func ServeError(resp http.ResponseWriter, req *http.Request, err error) (unsafe error)

func ServeJSON

func ServeJSON(resp http.ResponseWriter, req *http.Request, data interface{})

func UnsafeDisableCORS

func UnsafeDisableCORS(resp http.ResponseWriter, req *http.Request)

Types

type Middleware

type Middleware struct {
	UnsafeDisableCORS bool
	http.Handler
}

func (Middleware) ServeHTTP

func (m Middleware) ServeHTTP(resp http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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