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

Function durationFromAttributes

sdk/cliproxy/auth/conductor.go:5397–5409  ·  view source on GitHub ↗
(attrs map[string]string, keys ...string)

Source from the content-addressed store, hash-verified

5395}
5396
5397func durationFromAttributes(attrs map[string]string, keys ...string) time.Duration {
5398 if len(attrs) == 0 {
5399 return 0
5400 }
5401 for _, key := range keys {
5402 if val, ok := attrs[key]; ok {
5403 if dur := parseDurationString(val); dur > 0 {
5404 return dur
5405 }
5406 }
5407 }
5408 return 0
5409}
5410
5411func parseDurationValue(val any) time.Duration {
5412 switch v := val.(type) {

Callers 1

authPreferredIntervalFunction · 0.85

Calls 1

parseDurationStringFunction · 0.85

Tested by

no test coverage detected