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 DefinitionsApi(definitions map[string]spec.Schema, v interface{}, exclude []string)
- func Delete(p string) *apiInfo
- func DocList(w http.ResponseWriter, r *http.Request)
- func Get(p string) *apiInfo
- func GetMethodInfo(method *reflect.Method, preUrl string, httpContext reflect.Type) (info *apiInfo)
- func Head(p string) *apiInfo
- func Log(method, path, title string)
- func Markdown(filePath, modName string)
- func Options(p string) *apiInfo
- func Patch(p string) *apiInfo
- func Post(p string) *apiInfo
- func Put(p string) *apiInfo
- func RegisterApiInfo(apiInfo *GroupApiInfo)
- func Registered()
- func ResWriteReflect(w http.ResponseWriter, traceId string, result []reflect.Value)
- func Swagger(filePath, modName string)
- func Trace(p string) *apiInfo
- type ApiDocInfo
- type ApiInfo
- type GroupApiInfo
- type PMApi
- type PMBody
- type PMCategory
- type PMFile
- type PMHeader
- type PMInfo
- type PMProtocolProfileBehavior
- type PMQuery
- type PMRequest
- type PMUrl
- type Param
- type ParamTable
- type Params
- type ParseToHttpResponse
- type Service
Constants ¶
View Source
const Template = `` /* 345-byte string literal not displayed */
Variables ¶
View Source
var (
ErrorType = reflect.TypeOf((*error)(nil)).Elem()
)
Functions ¶
func CommonHandler ¶ added in v1.5.25
func DefinitionsApi ¶
func GetMethodInfo ¶
recover捕捉panic info
func RegisterApiInfo ¶ added in v1.5.0
func RegisterApiInfo(apiInfo *GroupApiInfo)
func Registered ¶
func Registered()
func ResWriteReflect ¶ added in v1.5.6
func ResWriteReflect(w http.ResponseWriter, traceId string, result []reflect.Value)
Types ¶
type ApiDocInfo ¶
type ApiInfo ¶
type ApiInfo struct {
Path, Method, Title string
Version int
Changelog []changelog
Createlog changelog
Deprecated *changelog
Middleware []http.HandlerFunc
}
func (*ApiInfo) GetApiInfo ¶
func (api *ApiInfo) GetApiInfo() *apiInfo
type GroupApiInfo ¶
type GroupApiInfo struct {
Describe string
Infos []*ApiDocInfo
}
type PMApi ¶
type PMApi struct {
Name string `json:"name"`
ProtocolProfileBehavior PMProtocolProfileBehavior `json:"protocolProfileBehavior"`
Request PMRequest `json:"request"`
Response []interface{} `json:"response"`
}
type PMCategory ¶
type PMCategory struct {
Name string `json:"name"`
ProtocolProfileBehavior PMProtocolProfileBehavior `json:"protocolProfileBehavior"`
Items []PMApi `json:"item"`
}
type PMFile ¶
type PMFile struct {
Info PMInfo `json:"info"`
Items []PMCategory `json:"item"`
}
type PMHeader ¶
type PMHeader struct {
Key string `json:"key"`
Value string `json:"value"`
Type string `json:"type"`
Disable bool `json:"disable"`
}
TODO
type PMProtocolProfileBehavior ¶
type PMProtocolProfileBehavior struct {
DisableBodyPruning bool `json:"disableBodyPruning"`
}
type ParamTable ¶
type ParamTable struct {
// contains filtered or unexported fields
}
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
