package
0.0.0-20240720041006-ecad64e70a65
Repository: https://github.com/ildomm/cceab.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
NewLoggingMiddleware initializes a new LoggingMiddleware.
NewRecoverMiddleware initializes a new RecoverMiddleware with the default response.
NewRecoverMiddlewareWithCustomResponse initializes a new RecoverMiddleware with a custom response.
NewServer is a factory to instantiate a new Server.
WriteAPIResponse takes an HTTP status code and a generic data struct and writes those as an HTTP response in a structured format.
WriteErrorResponse takes an HTTP status code and a slice of errors and writes those as an HTTP error response in a structured format.
WriteInternalError writes a default internal error message as an HTTP response.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
ErrorResponse is the generic error API response container.
No description provided by the author
HealthResponse represents the response for the health check.
LoggingMiddleware is a middleware that logs the request.
RecoverMiddleware recover any panics from upstream and return a 500 response.
Response is the generic API response container.
Server manages HTTP requests and dispatches them to the appropriate services.
StatusRecorder Source: https://upgear.io/blog/golang-tip-wrapping-http-response-writer-for-middleware/.
# Type aliases
RecoveryResponse This is the signature of the function that will be called when a panic is recovered.