func (e *Expiry) IsExpired() bool {
	curTime := e.CurrentTime
	if curTime == nil {
		curTime = time.Now
	}
	return e.expiration.Before(curTime())
}
IsExpired returns if the credentials are expired.
package credentials
import (
	"fmt"
	"sync/atomic"
	"time"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/internal/sync/singleflight"
)
var AnonymousCredentials = NewStaticCredentials("", "", "")
type Value struct {
	AccessKeyID string
	SecretAccessKey string
	SessionToken string
	ProviderName string
}
func (v Value) HasKeys() bool {
	return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0
}
type Provider interface {
	Retrieve() (Value, error)
	IsExpired() bool
}
type ProviderWithContext interface {
	Provider
	RetrieveWithContext(Context) (Value, error)
}
type Expirer interface {
	ExpiresAt() time.Time
}
type ErrorProvider struct {
	Err error
	ProviderName string
}
func (p ErrorProvider) Retrieve() (Value, error) {
	return Value{ProviderName: p.ProviderName}, p.Err
}
func (p ErrorProvider) IsExpired() bool {
	return false
}
type Expiry struct {
	expiration time.Time
	CurrentTime func() time.Time
}
func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) {
	e.expiration = expiration
	if window > 0 {
		e.expiration = e.expiration.Add(-window)
	}
}