增加数据位置定义

This commit is contained in:
白茶清欢 2024-06-23 14:01:47 +08:00
parent b83cc0dd45
commit f7667bcc76

View File

@ -8,16 +8,37 @@
package consts package consts
const ( const (
RequestLocationHeader = "HEADER" // header RequestDataLocationHeader = "HEADER" // header
RequestLocationCookie = "COOKIE" // cookie RequestDataLocationCookie = "COOKIE" // cookie
RequestLocationBody = "BODY" // body RequestDataLocationBody = "BODY" // body
RequestLocationQuery = "QUERY" // query RequestDataLocationQuery = "QUERY" // query
RequestLocationUriPath = "URI_PATH" // uri路由一部分 RequestDataLocationUriPath = "URI_PATH" // uri路由一部分
) )
const ( const (
ResponseLocationHeader = "HEADER" // header ResponseDataLocationHeader = "HEADER" // header
ResponseLocationCookie = "COOKIE" // cookie ResponseDataLocationCookie = "COOKIE" // cookie
ResponseLocationBody = "BODY" // body ResponseDataLocationBody = "BODY" // body
ResponseLocationExtension = "EXTENSION" // 扩展信息 ResponseDataLocationExtension = "EXTENSION" // 扩展信息
)
type DataLocationDesc struct {
Value string `json:"value"` // 数据位置
Description string `json:"description"` // 数据位置描述
}
var (
RequestDataLocationList = []DataLocationDesc{
{Value: RequestDataLocationHeader, Description: "请求header"},
{Value: RequestDataLocationCookie, Description: "请求cookie"},
{Value: RequestDataLocationBody, Description: "请求body"},
{Value: RequestDataLocationQuery, Description: "请求query"},
{Value: RequestDataLocationUriPath, Description: "请求uri_path"},
}
ResponseDataLocationList = []DataLocationDesc{
{Value: ResponseDataLocationHeader, Description: "响应header"},
{Value: ResponseDataLocationCookie, Description: "响应cookie"},
{Value: ResponseDataLocationBody, Description: "响应body"},
{Value: ResponseDataLocationExtension, Description: "响应扩展数据"},
}
) )