(raw string)
| 5472 | } |
| 5473 | |
| 5474 | func parseDurationString(raw string) time.Duration { |
| 5475 | s := strings.TrimSpace(raw) |
| 5476 | if s == "" { |
| 5477 | return 0 |
| 5478 | } |
| 5479 | if dur, err := time.ParseDuration(s); err == nil && dur > 0 { |
| 5480 | return dur |
| 5481 | } |
| 5482 | if secs, err := strconv.ParseFloat(s, 64); err == nil && secs > 0 { |
| 5483 | return time.Duration(secs * float64(time.Second)) |
| 5484 | } |
| 5485 | return 0 |
| 5486 | } |
| 5487 | |
| 5488 | func authLastRefreshTimestamp(a *Auth) (time.Time, bool) { |
| 5489 | if a == nil { |
no outgoing calls
no test coverage detected