httputils

package
v0.0.0-...-ca83fcd Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validate *validator.Validate

Validate validator

Functions

func Created

func Created(w http.ResponseWriter, r *http.Request, id string, v interface{})

Created object created

func Decode

func Decode(r *http.Request, v interface{}) error

Decode decodes and validates an object

func Err

func Err(w http.ResponseWriter, r *http.Request, err error)

Err writes an error response

func FileServer

func FileServer(r chi.Router, path string, root http.FileSystem)

FileServer conveniently sets up a http.FileServer handler to serve static files from a http.FileSystem.

func Param

func Param(r *http.Request, name string) (string, error)

Param gets the url param of the given request

Types

This section is empty.

Jump to

Keyboard shortcuts

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