Documentation
¶
Index ¶
- Constants
- Variables
- func Api(f func())
- func Connect(path string) *apiInfo
- func Delete(path string) *apiInfo
- func DocList(w http.ResponseWriter, r *http.Request)
- func ErrRespFrom(err any) *errors.ErrResp
- func GenOpenapi(methodInfo *ApiDocInfo, api *apidoc.API, dec string)
- func Get(path string) *apiInfo
- func GetDoc(modName string) *openapi3.T
- func GetMethodInfo(method *reflect.Method, preUrl string, httpContext reflect.Type) (info *apiInfo)
- func HandlerPrefix(p string)
- func Head(path string) *apiInfo
- func Log(method, path, title string)
- func Marshaler(marshaler httpx.MarshalFunc)
- func OpenApi(addr string)
- func Openapi(filePath, modName string)
- func Options(path string) *apiInfo
- func Patch(path string) *apiInfo
- func Post(path string) *apiInfo
- func Put(path string) *apiInfo
- func RegisterApiInfo(apiInfo *GroupApiInfo)
- func Registered()
- func Respond(ctx context.Context, w http.ResponseWriter, traceId string, ...) (int, error)
- func RespondError(ctx context.Context, w http.ResponseWriter, err any, traceId string) (int, error)
- func Trace(path string) *apiInfo
- type ApiDocInfo
- type ApiInfo
- type Changelog
- type ErrResp
- type GroupApiInfo
- type Route
- type Service
Constants ¶
View Source
const Template = `` /* 334-byte string literal not displayed */
Variables ¶
View Source
var ( ContextType = reflect.TypeOf((*context.Context)(nil)).Elem() ContextValue = reflect.ValueOf(context.Background()) ErrorType = reflect.TypeOf((*error)(nil)).Elem() )
View Source
var DefaultMarshaler = httpx.DefaultMarshal
View Source
var Doc *openapi3.T
View Source
var (
ErrRespType = reflect.TypeOf((*ErrResp)(nil))
)
Functions ¶
func ErrRespFrom ¶ added in v1.12.6
func GenOpenapi ¶ added in v1.12.14
func GenOpenapi(methodInfo *ApiDocInfo, api *apidoc.API, dec string)
func GetMethodInfo ¶
recover捕捉panic info
func HandlerPrefix ¶ added in v1.7.0
func HandlerPrefix(p string)
func Marshaler ¶ added in v1.13.9
func Marshaler(marshaler httpx.MarshalFunc)
func RegisterApiInfo ¶ added in v1.5.0
func RegisterApiInfo(apiInfo *GroupApiInfo)
func Registered ¶
func Registered()
func RespondError ¶ added in v1.13.9
Types ¶
type ApiDocInfo ¶
type GroupApiInfo ¶
type GroupApiInfo struct {
Describe string
Infos []*ApiDocInfo
}
Click to show internal directories.
Click to hide internal directories.
