Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
package tokenmanager
|
||||
|
||||
import "time"
|
||||
|
||||
// Config holds configuration for the token manager
|
||||
type Config struct {
|
||||
// RefreshBeforeExpiry is how long before expiry to refresh the token
|
||||
// Default: 1 minute
|
||||
RefreshBeforeExpiry time.Duration
|
||||
|
||||
// CheckInterval is how often to check if refresh is needed
|
||||
// Default: 30 seconds
|
||||
CheckInterval time.Duration
|
||||
|
||||
// MaxConsecutiveFailures is how many consecutive refresh failures before forcing logout
|
||||
// Default: 3
|
||||
MaxConsecutiveFailures int
|
||||
}
|
||||
|
||||
// DefaultConfig returns the default configuration
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
RefreshBeforeExpiry: 1 * time.Minute,
|
||||
CheckInterval: 30 * time.Second,
|
||||
MaxConsecutiveFailures: 3,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue