Struct: credentials.Expiry
Overview
A Expiry provides shared expiration logic to be used by credentials providers to implement expiry functionality.
The best method to use this struct is as an anonymous field within the provider's struct.
Example:
type EC2RoleProvider struct {
Expiry
...
}
Implemented Interfaces
s3crypto.Cipher, credentials.Expirer, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom
Method Summary collapse
-
func (e *Expiry) ExpiresAt() time.Time
ExpiresAt returns the expiration time of the credential.
-
func (e *Expiry) IsExpired() bool
IsExpired returns if the credentials are expired.
-
func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration)
SetExpiration sets the expiration IsExpired will check when called.
Method Details
func (e *Expiry) ExpiresAt() time.Time
ExpiresAt returns the expiration time of the credential
207 208 209 |
// File 'aws/credentials/credentials.go', line 207
|
func (e *Expiry) IsExpired() bool
IsExpired returns if the credentials are expired.
198 199 200 201 202 203 204 |
// File 'aws/credentials/credentials.go', line 198
|
func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration)
SetExpiration sets the expiration IsExpired will check when called.
If window is greater than 0 the expiration time will be reduced by the window value.
Using a window is helpful to trigger credentials to expire sooner than the expiration time given to ensure no requests are made with expired tokens.
188 189 190 191 192 193 194 195 |
// File 'aws/credentials/credentials.go', line 188
|