helpers

package
v0.2.54 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(w http.ResponseWriter, r *http.Request, out interface{}) bool

Bind decodes json into object

func GetIntParam

func GetIntParam(name string, w http.ResponseWriter, r *http.Request) (int, error)

GetIntParam fetches a parameter from the route variables as an integer redirects to a 404 or writes bad request state depending on error state

func QueryParams

func QueryParams(url *url.URL) db.RetrieveQueryParams

func Store

func Store(r *http.Request) db.Store

func TaskPool

func TaskPool(r *http.Request) *tasks.TaskPool

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteJSON

func WriteJSON(w http.ResponseWriter, code int, out interface{})

WriteJSON writes object as JSON

Types

type H

type H map[string]interface{}

H just a string-to-anything map

Jump to

Keyboard shortcuts

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