Documentation ¶
Index ¶
- type Response
- func (r *Response) Error(w http.ResponseWriter)
- func (r *Response) JSON(w http.ResponseWriter)
- func (r *Response) SetErrorMessage(message string) *Response
- func (r *Response) SetInternalError(serverError *ServerError) *Response
- func (r *Response) SetToken(token string) *Response
- func (r *Response) SetUser(data interface{}) *Response
- func (r *Response) SetUsers(datas interface{}) *Response
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { Function string Code int Payload struct { Success bool `json:"success"` Error *string `json:"error,omitempty"` Token *string `json:"token,omitempty"` User interface{} `json:"user,omitempty"` UserList interface{} `json:"userList,omitempty"` } InternalError *ServerError }
func (*Response) Error ¶
func (r *Response) Error(w http.ResponseWriter)
func (*Response) JSON ¶
func (r *Response) JSON(w http.ResponseWriter)
func (*Response) SetErrorMessage ¶
func (*Response) SetInternalError ¶
func (r *Response) SetInternalError(serverError *ServerError) *Response
type ServerError ¶
func CreateInternalError ¶
func CreateInternalError(query string, args []interface{}, err error) *ServerError
Click to show internal directories.
Click to hide internal directories.