Versions in this module Expand all Collapse all v0 v0.0.2 Dec 9, 2021 v0.0.1 Oct 19, 2021 Changes in this version + func Bind(req *http.Request, data interface{}) error + func BindForm(req *http.Request, data interface{}) error + func BindJSON(req *http.Request, data interface{}) error + func BindURI(req *http.Request, data interface{}) error + func Convert(h Handler) func(req *http.Request) *Result + func ErrorRender(err error, w http.ResponseWriter, req *http.Request) + func JSONDeserializer(req *http.Request, data interface{}) error + func RawConvert(h Handler) func(req *http.Request) *Result + func Render(w http.ResponseWriter, req *http.Request, res *Result) + func ValidateData(data interface{}, lang ut.Translator) error + type Endpoint struct + Authorizer iauth.Authorizer + Handler func(*http.Request) *Result + Method string + Path string + RegisterHandler func(*mux.Router) *mux.Route + func (ep *Endpoint) Register(router *mux.Router) *mux.Router + func (ep *Endpoint) ServeHTTP(rw http.ResponseWriter, req *http.Request) + func (re *Endpoint) String() string + type Handler func(req *http.Request) (interface{}, error) + type RequestInfo struct + ClientIP string + Duration time.Duration + ErrDetail string + LogID string + Method string + RetMsg string + StartTime time.Time + StatusCode int + URLPath string + URLPattern string + func GetRequestInfo(ctx context.Context) *RequestInfo + func InitRequestInfo(ctx context.Context, req *http.Request) (context.Context, *RequestInfo) + func (requestInfo *RequestInfo) String() string + type Result struct + Code int + Data interface{} + ErrMsg string + ErrorDetail string + ManualURL string + OriginErr error + Render func(w http.ResponseWriter, req *http.Request, res *Result) + func (res *Result) Error() string + func (res *Result) IsSucc() bool