req

package
v0.0.0-...-00f2437 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthToken

func CheckAuthToken(logger golog.Logger, cfg config.Config, r *http.Request) (*auth.AuthToken, resp.Responder)

CheckAuthToken ensures an API authentication token is provided via the "Authorization" header. If present the auth token will be returned. Otherwise a response which sends an error will be returned.

func DecodeJSON

func DecodeJSON(logger golog.Logger, r *http.Request, dest interface{}) resp.Responder

DecodeJSON decodes a JSON formatted request body. Returns an ErrorResponder if an error occurs while decoding the body.

func DecodeValidatedJSON

func DecodeValidatedJSON(logger golog.Logger, r *http.Request, dest interface{}) resp.Responder

DecodeValidatedJSON decodes a JSON formatted request body and validates it. Returns an ErrorResponder if an error occurs while decoding or validating the body.

Types

This section is empty.

Jump to

Keyboard shortcuts

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