MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / parseToInt64

Function parseToInt64

log-driver/loki/loki.go:282–300  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

280}
281
282func parseToInt64(v interface{}) int64 {
283 switch t := v.(type) {
284 case int:
285 return int64(t)
286 case int64:
287 return t
288 case string:
289 if v == "" {
290 return 0
291 }
292 i, err := strconv.ParseInt(t, 10, 64)
293 if err != nil {
294 return 0
295 }
296 return i
297 default:
298 return 0
299 }
300}
301
302func (d *Driver) logCount(clusterId string, conditions map[string]string, start time.Time, end time.Time) (int64, error) {
303 // 先查在这段时间内符合条件的日志数量

Callers 1

ToLogItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected