api_supported_methods

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL