Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateStruct ¶
func ValidateStruct(s interface{}) error
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, statusCode int, response JSONResponse)
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Status bool `json:"status"` Message string `json:"message,omitempty"` Errors interface{} `json:"errors,omitempty"` }
func UnmarshalRequest ¶
func UnmarshalRequest(r *http.Request, v interface{}) *ErrorResponse
func (*ErrorResponse) GetMessage ¶
func (er *ErrorResponse) GetMessage() string
func (*ErrorResponse) GetStatus ¶
func (er *ErrorResponse) GetStatus() bool
type JSONResponse ¶
type SuccessResponse ¶
type SuccessResponse struct { Status bool `json:"status"` Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` }
func (*SuccessResponse) GetMessage ¶
func (sr *SuccessResponse) GetMessage() string
func (*SuccessResponse) GetStatus ¶
func (sr *SuccessResponse) GetStatus() bool
Click to show internal directories.
Click to hide internal directories.