Documentation ¶
Index ¶
Constants ¶
View Source
const ( SUCCESS = 200 CREATED = 201 ERROR = 500 INVALID_PARAMS = 400 NOT_AUTHORIED = 403 NOT_FOUND = 404 ALREADY_EXIST = 409 )
Variables ¶
View Source
var Msg = map[int]string{ SUCCESS: "OK", CREATED: "Created", ERROR: "Fail", INVALID_PARAMS: "Invalid Parameters", NOT_AUTHORIED: "Client Not Authorized", NOT_FOUND: "Resource Not Found", ALREADY_EXIST: "Resource Already Exist", }
Functions ¶
Types ¶
type GoatResponse ¶
type GoatResponse struct { Context *gin.Context `json:"-"` Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
GoatResponse defines the structure of response data
func (GoatResponse) Response ¶
func (c GoatResponse) Response(status_code, err_code int, data interface{})
Click to show internal directories.
Click to hide internal directories.