utils

package
v0.0.0-...-32bbb43 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundHandler = func(next http.Handler) http.Handler {

	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusNotFound)
		Respond(w, Message(http.StatusNotFound, "Resource was not found"))
		next.ServeHTTP(w, r)
	})
}

Functions

func LoginFromCookie

func LoginFromCookie(r *http.Request) (string, error)

func Message

func Message(status int, message string) map[string]interface{}

func Respond

func Respond(w http.ResponseWriter, data map[string]interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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