Documentation
¶
Index ¶
- Variables
- func GetBody(r *http.Request, v any) error
- func Send(w http.ResponseWriter, res any, status int)
- func SendData(w http.ResponseWriter, data interface{}, status int)
- func SendError(w http.ResponseWriter, err error, status int)
- func SendMessage(w http.ResponseWriter, message string, status int)
- type DataJsonResponse
- type ErrorJsonResponse
- type MessageJsonResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInternalServer = errors.New("internal server errror") ErrDecodeJsonBody = errors.New("error decode json body") )
Functions ¶
func SendData ¶
func SendData(w http.ResponseWriter, data interface{}, status int)
func SendMessage ¶
func SendMessage(w http.ResponseWriter, message string, status int)
Types ¶
type DataJsonResponse ¶
type DataJsonResponse struct {
Data interface{} `json:"data"`
}
type ErrorJsonResponse ¶
type ErrorJsonResponse struct {
Error string `json:"error"`
}
type MessageJsonResponse ¶
type MessageJsonResponse struct {
Message string `json:"message"`
}
Click to show internal directories.
Click to hide internal directories.