package
0.0.0-20240610062620-ae91460cca54
Repository: https://github.com/rahulyadav0296/inventorymanagement.git
Documentation: pkg.go.dev

# Functions

Decode reads the body of an HTTP request looking for a JSON document.
ErrBadRequest wraps a provided error with an HTTP status code and custome status code for bad request.
ErrForbidden wraps a provided error with an HTTP status code and custome status code for forbidden.
ErrInternal wraps a provided error with an HTTP status code and custome status code for internal server error.
ErrNewRequest wraps a provided error with an HTTP status code and custome status code.
ErrNotFound wraps a provided error with an HTTP status code and custome status code for not found.
GetCode is function to generate code of transaction.
NewApp is function to create new App.
Response converts a Go value to JSON and sends it to the client.
ResponseError sends an error reponse back to the client.
ResponseOK converts a Go value to JSON and sends it to the client.

# Constants

StatusCodeBadRequest is custome status code for bad request.
StatusCodeForbidden is custome status code for forbidden.
StatusCodeInternalServerError is custome status for unkown error / internal server error.
StatusCodeNotFound is custome status code for not found.
StatusCodeOK is custome status code for ok.
StatusMessageBadRequest is custome status message for bad request.
StatusMessageForbidden is custome status message for forbidden.
StatusMessageInternalError is custome status message for unknown error / internal server error.
StatusMessageNotFound is custome status message for data not found.
StatusMessageOK is custome status message for ok.

# Structs

App is the entrypoint into our application and what controls the context of each request.
Error is used to pass an error during the request through the application with web specific context.
ErrorResponse is the form used for API responses from failures in the API.
ResponseFormat is used to pass an response in standard format.

# Type aliases

Ctx type for encapsulated context key.
Handler type for force httprouter into standard http handler.
Middleware is a function designed to run some code before and/or after another Handler.