Documentation ¶
Index ¶
Constants ¶
View Source
const BadRequestPrefix string = "Bad Request"
View Source
const InternalServerErrorPrefix string = "Internal Server Error"
View Source
const NotFoundPrefix string = "404 Not Found"
View Source
const NotImplementedPrefix string = "Not Implemented"
View Source
const UnprocessablePrefix string = "Unprocessable Entity"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataResponse ¶
type DataResponse struct { Code int `json:"code"` Data interface{} `json:"data"` }
type ErrorHandler ¶
type ErrorHandler struct{}
func (*ErrorHandler) Write ¶
func (t *ErrorHandler) Write(rw http.ResponseWriter, err error, statusCode int)
type ErrorResponder ¶
type ErrorResponder interface {
Write(rw http.ResponseWriter, err error, statusCode int)
}
type RESTAPIHandler ¶
type Responder ¶
type Responder interface { Write(rw http.ResponseWriter, data interface{}, statusCode int) WriteRaw(rw http.ResponseWriter, data interface{}, statusCode int) Redirect(rw http.ResponseWriter, r *http.Request, uri string) }
type ResponseHandler ¶
type ResponseHandler struct{}
func (*ResponseHandler) Redirect ¶
func (t *ResponseHandler) Redirect(rw http.ResponseWriter, r *http.Request, uri string)
func (*ResponseHandler) Write ¶
func (t *ResponseHandler) Write(rw http.ResponseWriter, data interface{}, statusCode int)
func (*ResponseHandler) WriteRaw ¶
func (t *ResponseHandler) WriteRaw(rw http.ResponseWriter, data interface{}, statusCode int)
type ServerResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.