package
0.0.0-20231119140317-f264ef5114c8
Repository: https://github.com/candyfet/service.git
Documentation: pkg.go.dev
# Functions
Decode reads the body of an HTTP request looking for a JSON document.
IsShutdown checks to see if shutdown error is conained in the specified error value.
NewApp creates an App value taht handle a set of routes for the application.
NewRequestError wraps a provided error with an HTTP status code.
NewShutdownError returns an error thet causes the framework to signal a graceful shutdown.
Params return the web call parameters frome the request.
Respond converts a go value to JSON and sends it to the client.
RespondError sends and error response back to the client.
# Constants
KeyValues is how request values are stored/retrieved.
# Structs
App is entrypoint into our application and what configures our context ibject for each of our http handlers.
Error is used to pass an error during the request through the application with web specific context.
ErrorResponse is the forrm used for API responses from failures in the API.
FieldError is used to indicate an error with a specific request field.
Values represents state for each request.
# Type aliases
Handler is a type thet handles an http request within our own little mini framework.
Middleware is a function designed to run some code befoe and/or afer another Handler.