Documentation ¶
Index ¶
- Constants
- Variables
- func Api(f func())
- func CommonHandler(w http.ResponseWriter, req *http.Request, handle *reflect.Value, ps *Params)
- func Connect(p string) *apiInfo
- func Delete(p string) *apiInfo
- func Get(p string) *apiInfo
- func GetMethodInfo(method *reflect.Method, preUrl string, httpContext reflect.Type) (info *apiInfo)
- func HandlerPrefix(p string)
- func Head(p string) *apiInfo
- func Log(method, path, title string)
- func Options(p string) *apiInfo
- func Patch(p string) *apiInfo
- func Post(p string) *apiInfo
- func Put(p string) *apiInfo
- func Registered()
- func ResWriteReflect(w http.ResponseWriter, traceId string, result []reflect.Value)
- func Trace(p string) *apiInfo
- type ApiInfo
- type Param
- type Params
- type ParseToHttpResponse
- type Service
Constants ¶
View Source
const Template = `` /* 345-byte string literal not displayed */
Variables ¶
Functions ¶
func CommonHandler ¶ added in v1.5.25
func GetMethodInfo ¶
recover捕捉panic info
func HandlerPrefix ¶ added in v1.7.0
func HandlerPrefix(p string)
func Registered ¶
func Registered()
func ResWriteReflect ¶ added in v1.5.6
func ResWriteReflect(w http.ResponseWriter, traceId string, result []reflect.Value)
Types ¶
type ApiInfo ¶
type ApiInfo struct {
Path, Method, Title string
Version int
Changelog []changelog
Createlog changelog
Deprecated *changelog
Middleware []http.HandlerFunc
}
type Params ¶ added in v1.5.25
type Params []Param
Params is a Param-slice, as returned by the router. The slice is ordered, the first URL parameter is also the first slice value. It is therefore safe to read values by the index.
type ParseToHttpResponse ¶
Click to show internal directories.
Click to hide internal directories.