Documentation ¶
Index ¶
- Constants
- type BaseHandler
- func (h *BaseHandler) BadRequest(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) FileSuccess(w http.ResponseWriter, r *http.Request, data interface{}, fileName string)
- func (h *BaseHandler) Forbidden(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) Internal(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) NotFound(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) PageableSuccess(w http.ResponseWriter, r *http.Request, data interface{}, total int64)
- func (h *BaseHandler) RequestParamArray(r *http.Request, key string) []string
- func (h *BaseHandler) RequestParamBool(r *http.Request, key string, defaultValue bool) bool
- func (h *BaseHandler) RequestParamInt(r *http.Request, key string, defaultValue int64) int64
- func (h *BaseHandler) RequestParamStr(r *http.Request, key string) string
- func (h *BaseHandler) RequestParamStrWithDefault(r *http.Request, key string, defaultValue string) string
- func (h *BaseHandler) Success(w http.ResponseWriter, r *http.Request, data interface{})
- func (h *BaseHandler) TooManyRequests(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) Unauthorized(w http.ResponseWriter, r *http.Request, err error)
- func (h *BaseHandler) WithLogConfig(conf LogConfig) *BaseHandler
- type LogConfig
Constants ¶
View Source
const ( LimitKey string = "limit" OffsetKey string = "offset" SortByKey string = "sort_by" OrderKey string = "order" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶
func NewBaseHandler() *BaseHandler
func (*BaseHandler) BadRequest ¶
func (h *BaseHandler) BadRequest(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) FileSuccess ¶
func (h *BaseHandler) FileSuccess(w http.ResponseWriter, r *http.Request, data interface{}, fileName string)
func (*BaseHandler) Forbidden ¶
func (h *BaseHandler) Forbidden(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) Internal ¶
func (h *BaseHandler) Internal(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) NotFound ¶
func (h *BaseHandler) NotFound(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) PageableSuccess ¶
func (h *BaseHandler) PageableSuccess(w http.ResponseWriter, r *http.Request, data interface{}, total int64)
func (*BaseHandler) RequestParamArray ¶
func (h *BaseHandler) RequestParamArray(r *http.Request, key string) []string
func (*BaseHandler) RequestParamBool ¶
func (*BaseHandler) RequestParamInt ¶
func (*BaseHandler) RequestParamStr ¶
func (h *BaseHandler) RequestParamStr(r *http.Request, key string) string
func (*BaseHandler) RequestParamStrWithDefault ¶
func (*BaseHandler) Success ¶
func (h *BaseHandler) Success(w http.ResponseWriter, r *http.Request, data interface{})
func (*BaseHandler) TooManyRequests ¶
func (h *BaseHandler) TooManyRequests(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) Unauthorized ¶
func (h *BaseHandler) Unauthorized(w http.ResponseWriter, r *http.Request, err error)
func (*BaseHandler) WithLogConfig ¶
func (h *BaseHandler) WithLogConfig(conf LogConfig) *BaseHandler
Click to show internal directories.
Click to hide internal directories.