Documentation
¶
Index ¶
- Constants
- func BuildOrderMap(orderedKeys []string) map[string]int
- func GetKvsFromPool() *[]KeyValues
- func IsExcluded(key string) bool
- func PutKvsToPool(p *[]KeyValues)
- func SortKeyValues(kvs []KeyValues, orderedKeys []string)
- func SortKeyValuesCached(kvs []KeyValues, order map[string]int)
- type KeyValues
Constants ¶
View Source
const ( DefaultUserAgent = "req/v3 (https://github.com/stoney-work/req)" UserAgent = "User-Agent" Location = "Location" ContentType = "Content-Type" PlainTextContentType = "text/plain; charset=utf-8" JsonContentType = "application/json; charset=utf-8" XmlContentType = "text/xml; charset=utf-8" FormContentType = "application/x-www-form-urlencoded" WwwAuthenticate = "WWW-Authenticate" Authorization = "Authorization" HeaderOderKey = "__header_order__" PseudoHeaderOderKey = "__pseudo_header_order__" )
Variables ¶
This section is empty.
Functions ¶
func BuildOrderMap ¶
BuildOrderMap 根据有序 key 列表预计算 order map,供 SortKeyValuesCached 使用。 应在 client 初始化时调用一次,结果缓存在 Transport 中。
func IsExcluded ¶
func PutKvsToPool ¶
func PutKvsToPool(p *[]KeyValues)
PutKvsToPool 将 []KeyValues 清空后归还 pool,保留底层数组内存。
func SortKeyValues ¶
SortKeyValues 原有接口保持不变,供未缓存场景兜底使用。
func SortKeyValuesCached ¶
SortKeyValuesCached 使用预计算好的 order map 排序,避免每次请求重新 make(map)。
Types ¶
Click to show internal directories.
Click to hide internal directories.