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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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