Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, rc *RequestContext) context.Context
NewContext 创建新的上下文
Types ¶
type RequestContext ¶
type RequestContext struct {
RequestQuery *datatypes.JSON `json:"request_query"`
RequestBody *datatypes.JSON `json:"request_body"`
// 添加一个通用的map用于存储自定义数据
CustomData map[string]any `json:"custom_data"`
// contains filtered or unexported fields
}
func (*RequestContext) Get ¶ added in v1.0.9
func (rc *RequestContext) Get(key string) (any, bool)
Get 获取自定义数据
func (*RequestContext) GetInt ¶ added in v1.0.9
func (rc *RequestContext) GetInt(key string) (int, bool)
GetInt 获取整数类型的值
func (*RequestContext) GetString ¶ added in v1.0.9
func (rc *RequestContext) GetString(key string) (string, bool)
GetString 获取字符串类型的值
func (*RequestContext) Set ¶ added in v1.0.9
func (rc *RequestContext) Set(key string, value any)
Set 设置自定义数据
Click to show internal directories.
Click to hide internal directories.