package
Version:
v0.0.0-...-961a225
Opens a new window with list of versions in this module.
Published: Dec 13, 2024
License: MIT
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
BindForm 函数用于将 HTTP 请求中的表单数据绑定到指定的目标对象上。
参数:
- req:包含表单数据的 http.Request 对象。
- target:目标对象的指针,表单数据将被绑定到该对象上。
返回值:
- error:如果在绑定过程中发生错误,返回相应的错误信息;否则返回 nil。
BindQuery 函数用于将 URL 中的查询参数绑定到指定的目标对象上。
参数:
- vars:包含查询参数的 url.Values 对象。
- target:目标对象的指针,查询参数将被绑定到该对象上。
返回值:
- error:如果在绑定过程中发生错误,返回相应的错误信息;否则返回 nil。
EncodeURL 将 proto 消息编码为 URL 路径。
pathTemplate 是路径模板,msg 是要编码的 proto 消息,needQuery 表示是否需要将剩余的查询参数附加到 URL 中。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.