Documentation
¶
Index ¶
- func BadRequest(w http.ResponseWriter, err error)
- func Error(w http.ResponseWriter, err error)
- func InternalServerError(w http.ResponseWriter)
- func OK(w http.ResponseWriter, data interface{})
- func OKChar(w http.ResponseWriter, isBanned bool, isAdmin bool, data interface{})
- func Result(w http.ResponseWriter, b bool)
- func TooManyRequests(w http.ResponseWriter)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, err error)
func Error ¶
func Error(w http.ResponseWriter, err error)
func InternalServerError ¶ added in v1.3.1
func InternalServerError(w http.ResponseWriter)
func OK ¶
func OK(w http.ResponseWriter, data interface{})
func Result ¶
func Result(w http.ResponseWriter, b bool)
func TooManyRequests ¶ added in v1.3.0
func TooManyRequests(w http.ResponseWriter)
Types ¶
type Response ¶
type Response struct {
Code int `json:"code"`
Status bool `json:"status"`
Error string `json:"error"`
Data interface{} `json:"data"`
IsBanned *bool `json:"isBanned,omitempty"`
IsAdmin *bool `json:"isAdmin,omitempty"`
// contains filtered or unexported fields
}
make public so other packages can create custom responses.
Click to show internal directories.
Click to hide internal directories.