MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / parseDurationString

Function parseDurationString

sdk/cliproxy/auth/conductor.go:5474–5486  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

5472}
5473
5474func 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
5488func authLastRefreshTimestamp(a *Auth) (time.Time, bool) {
5489 if a == nil {

Callers 2

durationFromAttributesFunction · 0.85
parseDurationValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected