Documentation
¶
Overview ¶
Package api_supported_methods stores protocol-neutral API method definitions. 方法注册表同时是 API 文档的唯一事实源:新增方法后执行根目录 gen_api_docs.sh 重新生成方法清单。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMethod ¶
func AddMethod(method *SupportedMethod)
func SupportedMethodsSetup ¶
func SupportedMethodsSetup()
Types ¶
type SupportedMethod ¶
type SupportedMethod struct {
Name string
Description string
InputSchema map[string]interface{}
Async bool
// Public 为 true 的方法免统一准入门禁(如 test、验证码、注册、登录);
// 零值 false = 受保护,APIExecuter 在 Execute 前验证 arguments.jwt_token(fail-closed),
// 验证后即从 arguments 移除,业务 Execute 只见业务参数;
// jwt_token 入参 schema 由注册表按非 Public 自动注入,业务注册禁止声明。
Public bool
Execute func(context.Context, interface{}) (interface{}, error)
}
func Method ¶
func Method(name string) (*SupportedMethod, bool)
func Methods ¶
func Methods() []SupportedMethod
Click to show internal directories.
Click to hide internal directories.