u_handler

package
v1.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 (h *BaseHandler) RequestParamBool(r *http.Request, key string, defaultValue bool) bool

func (*BaseHandler) RequestParamInt

func (h *BaseHandler) RequestParamInt(r *http.Request, key string, defaultValue int64) int64

func (*BaseHandler) RequestParamStr

func (h *BaseHandler) RequestParamStr(r *http.Request, key string) string

func (*BaseHandler) RequestParamStrWithDefault

func (h *BaseHandler) RequestParamStrWithDefault(r *http.Request, key string, defaultValue string) string

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

type LogConfig

type LogConfig interface {
	StatusConfig() map[int]bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL