web

package
v0.0.0-...-c4da31e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r *http.Request, val any) error

func Handle

func Handle(h APIHandler) http.HandlerFunc

func ReadIDParam

func ReadIDParam(r *http.Request) (uuid.UUID, error)

func Respond

func Respond(w http.ResponseWriter, data any, statusCode int) error

Respond converts a Go value to JSON and sends it to the client.

Types

type APIHandler

type APIHandler func(w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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