Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RecordNotFound : Code error for not found RecordNotFound = 20023 // ResourceNotFound : Code error for recurse not found ResourceNotFound = 20022 // BadRequest : Code error for invalid request BadRequest = 20001 // InternalServerError : Code error for internal server error InternalServerError = 10000 Unauthorized = 30001 )
Variables ¶
This section is empty.
Functions ¶
func GenerateHTTPResponse ¶
func GenerateHTTPResponse(w http.ResponseWriter, statusCode int, response interface{})
GenerateHTTPResponse : Generate http response
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { DeveloperMessage string `json:"developerMessage"` UserMessage string `json:"userMessage"` ErrorCode int `json:"errorCode"` MoreInfo string `json:"moreInfo"` }
ErrorResponse : Struct of error for response
func GenerateErrorResponse ¶
func GenerateErrorResponse(errorCode int, developerMessage, userMessage string) ErrorResponse
GenerateErrorResponse : Generate error response
type SuccessResponse ¶
type SuccessResponse struct { Meta meta `json:"meta"` Records interface{} `json:"records"` }
SuccessResponse : Struct of success for response
func GenerateSuccessResponse ¶
func GenerateSuccessResponse(obj interface{}, limit, offset, recordCount int) SuccessResponse
GenerateSuccessResponse : Generate response of success
Click to show internal directories.
Click to hide internal directories.