MCPcopy Create free account
hub / github.com/deepflowio/deepflow / GetByFilter

Function GetByFilter

cli/ctl/common/http_util.go:244–261  ·  view source on GitHub ↗

GetByFilter 通过 Get 方法获取数据,自动拼接 url param 参数

(url string, body, filters map[string]interface{}, opts ...HTTPOption)

Source from the content-addressed store, hash-verified

242
243// GetByFilter 通过 Get 方法获取数据,自动拼接 url param 参数
244func GetByFilter(url string, body, filters map[string]interface{}, opts ...HTTPOption) (*simplejson.Json, error) {
245 if !strings.HasSuffix(url, "/") {
246 url = url + "/"
247 }
248 if !strings.HasSuffix(url, "?") {
249 url = url + "?"
250 }
251
252 i, count := 0, len(filters)
253 for k, v := range filters {
254 url += fmt.Sprintf("%v=%v", k, v)
255 if i < count-1 {
256 url += "&"
257 }
258 i++
259 }
260 return CURLPerform("GET", url, body, "", opts...)
261}
262
263var chinesePunctuationRegex = regexp.MustCompile("[(\u4e00-\u9fa5)(\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3010|\u3011|\u007e)]+")
264

Callers

nothing calls this directly

Calls 1

CURLPerformFunction · 0.70

Tested by

no test coverage detected