package
Version:
v0.0.0-...-ee3c536
Opens a new window with list of versions in this module.
Published: Apr 12, 2019
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
JSONError handles the response for the client.
JSONOK sends an http.StatusOK as the response together with the custom response `JSONResponse`.
type Config struct {
Message string
StatusCode uint
Data interface{}
}
Config sets the different response configuration when returning a JSON responses.
Configure configures the response by a given message, statusCode, data.
type JSONResponse struct {
StatusCode uint `json:"status_code"`
Message string `json:"message"`
Success bool `json:"success"`
Data interface{} `json:"data"`
}
JSONResponse custom json response
Source Files
¶
Click to show internal directories.
Click to hide internal directories.