Documentation ¶
Index ¶
- func WrapJson(methodController map[string]*Api) func(response http.ResponseWriter, request *http.Request)
- type Api
- func (api *Api) ControllerFunc() ApiHandlerType
- func (api *Api) Description() string
- func (api *Api) IsIgnoreRootPath() bool
- func (api *Api) Method() api_session.ApiMethod
- func (api *Api) ParamType() string
- func (api *Api) Params() interface{}
- func (api *Api) Path() string
- func (api *Api) Strategies() []StrategyData
- type ApiHandlerType
- type NewApiParamsType
- type ReturnHookFuncType
- type StrategyData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func NewApi ¶
func NewApi(params *NewApiParamsType) *Api
func (*Api) ControllerFunc ¶ added in v1.4.1
func (api *Api) ControllerFunc() ApiHandlerType
func (*Api) Description ¶
func (*Api) IsIgnoreRootPath ¶ added in v1.4.1
func (*Api) Method ¶
func (api *Api) Method() api_session.ApiMethod
func (*Api) Strategies ¶
func (api *Api) Strategies() []StrategyData
type ApiHandlerType ¶
type ApiHandlerType func(apiSession i_core.IApiSession) (interface{}, *t_error.ErrorInfo)
type NewApiParamsType ¶ added in v1.4.1
type NewApiParamsType struct { Description string Path string // api路径 IsIgnoreRootPath bool // api路径是否忽略根路径 IsIgnoreGlobalStrategies bool // 是否跳过全局策略 Method api_session.ApiMethod // api方法 Strategies []StrategyData // api前置处理策略,不包含全局策略 Params interface{} // api参数 ReturnValue interface{} // api返回值 ControllerFunc ApiHandlerType // api业务处理器 ParamType string // 参数类型。默认 application/json,可选 multipart/form-data,空表示都支持 ReturnHookFunc ReturnHookFuncType // 返回前的处理函数 }
type ReturnHookFuncType ¶
type StrategyData ¶ added in v1.3.1
type StrategyData struct { Strategy i_core.IApiStrategy Disable bool }
Click to show internal directories.
Click to hide internal directories.