http

package
v0.0.0-...-0a5c495 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePathString

func ParsePathString(w http.ResponseWriter, r *http.Request, key string) (string, int)

ParsePathString parses the string value from the route and returns it stats 0 -> ok || status 1 -> error

func ParsePrimitiveID

func ParsePrimitiveID(w http.ResponseWriter, r *http.Request) primitive.ObjectID

ParsePrimitiveID parses the id from the route and returns it returns primitive.NilObjectID if an error occured sends a respond if an error occured

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, message string)

RespondWithError Creates an error payload and adds the error message to be returned

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})

RespondWithJSON parses the passed payload and returns it with the specified code to the client

Types

This section is empty.

Jump to

Keyboard shortcuts

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