Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTetapTenangTetapSemangat = CustomError{ Message: "Tetap Tenang Tetap Semangat", Code: 999, HTTPCode: http.StatusInternalServerError, } )
Functions ¶
func Write ¶
func Write(w http.ResponseWriter, result interface{})
func WriteJson ¶
func WriteJson(w http.ResponseWriter, result interface{}, status int)
Types ¶
type CustomError ¶
func (CustomError) Error ¶
func (c CustomError) Error() string
type ErrorBody ¶
type ErrorBody struct { Errors []ErrorInfo `json:"errors"` Meta interface{} `json:"meta"` }
func BuildError ¶
type SuccessBody ¶
type SuccessBody struct { Data interface{} `json:"data"` Meta interface{} `json:"meta"` }
func BuildSuccess ¶
func BuildSuccess(data, meta interface{}) SuccessBody
Click to show internal directories.
Click to hide internal directories.