MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / formatWhereKey

Function formatWhereKey

service/monitor/iml.go:230–250  ·  view source on GitHub ↗
(wheres []MonWhereItem)

Source from the content-addressed store, hash-verified

228}
229
230func formatWhereKey(wheres []MonWhereItem) string {
231
232 whereMap := make(map[string]MonWhereItem)
233 keys := make([]string, 0, len(wheres))
234 for _, where := range wheres {
235 whereMap[where.Key] = where
236 keys = append(keys, where.Key)
237 }
238
239 sort.Strings(keys)
240
241 redisKeys := make([]string, 0)
242 for _, key := range keys {
243 if v, ok := whereMap[key]; ok {
244 sort.Strings(v.Values)
245 redisKeys = append(redisKeys, fmt.Sprintf("%v", strings.Join(v.Values, "_")))
246 }
247 }
248
249 return strings.Join(redisKeys, ":")
250}

Callers 6

GetStatisticsCacheMethod · 0.85
SetStatisticsCacheMethod · 0.85
GetTrendCacheMethod · 0.85
SetTrendCacheMethod · 0.85
GetMessageTrendMethod · 0.85
SetMessageTrendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected