Documentation
¶
Index ¶
- Constants
- Variables
- func Api(f func())
- func Connect(p string) *apiInfo
- func DefinitionsApi(definitions map[string]spec.Schema, v interface{}, exclude []string)
- func Delete(p string) *apiInfo
- func GenApiDoc(modName string)
- 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 Registered[T any](svcs []Service[T])
- func ResHandler[T any](c *contexti.RequestContext[T], w http.ResponseWriter, 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 ParamTable
- type ParseToHttpResponse
- type Service
Constants ¶
View Source
const Template = `` /* 349-byte string literal not displayed */
Variables ¶
View Source
var (
ErrorType = reflect.TypeOf((*error)(nil)).Elem()
)
View Source
var GroupApiInfos []*GroupApiInfo
Functions ¶
func DefinitionsApi ¶
func GetMethodInfo ¶
recover捕捉panic info
func Registered ¶
func ResHandler ¶
func ResHandler[T any](c *contexti.RequestContext[T], w http.ResponseWriter, 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 ParseToHttpResponse ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
