(a *Auth)
| 5368 | } |
| 5369 | |
| 5370 | func authPreferredInterval(a *Auth) time.Duration { |
| 5371 | if a == nil { |
| 5372 | return 0 |
| 5373 | } |
| 5374 | if d := durationFromMetadata(a.Metadata, "refresh_interval_seconds", "refreshIntervalSeconds", "refresh_interval", "refreshInterval"); d > 0 { |
| 5375 | return d |
| 5376 | } |
| 5377 | if d := durationFromAttributes(a.Attributes, "refresh_interval_seconds", "refreshIntervalSeconds", "refresh_interval", "refreshInterval"); d > 0 { |
| 5378 | return d |
| 5379 | } |
| 5380 | return 0 |
| 5381 | } |
| 5382 | |
| 5383 | func durationFromMetadata(meta map[string]any, keys ...string) time.Duration { |
| 5384 | if len(meta) == 0 { |
no test coverage detected