Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EksctlGlobalEnableCachingEnvName defines an environment property to enable the cache globally. EksctlGlobalEnableCachingEnvName = "EKSCTL_ENABLE_CREDENTIAL_CACHE" // EksctlCacheFilenameEnvName defines an environment property to configure where the cache file should live. EksctlCacheFilenameEnvName = "EKSCTL_CREDENTIAL_CACHE_FILENAME" )
Variables ¶
This section is empty.
Functions ¶
func GetCacheFilePath ¶ added in v0.90.0
GetCacheFilePath gets the filename to use for caching credentials.
Types ¶
type FileCacheV2 ¶ added in v0.90.0
type FileCacheV2 struct {
// contains filtered or unexported fields
}
FileCacheV2 is a file-based credentials cache for AWS credentials that can expire, satisfying the aws.CredentialsProvider interface. It is meant to be wrapped with aws.CredentialsCache. The cache is per profile.
func NewFileCacheV2 ¶ added in v0.90.0
func NewFileCacheV2(provider aws.CredentialsProvider, profileName string, fs afero.Fs, newFlock FlockFunc, clock Clock, cacheFilePath string) (*FileCacheV2, error)
NewFileCacheV2 initializes the cache and returns a *FileCacheV2.
func (*FileCacheV2) Retrieve ¶ added in v0.90.0
func (f *FileCacheV2) Retrieve(ctx context.Context) (aws.Credentials, error)
Retrieve implements aws.CredentialsProvider.
type Flock ¶ added in v0.90.0
type Flock interface { // TryRLockContext repeatedly tries to take a shared lock until one of the // conditions is met: TryRLock succeeds, TryRLock fails with error, or Context // Done channel is closed. TryRLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) // TryLockContext repeatedly tries to take an exclusive lock until one of the // conditions is met: TryLock succeeds, TryLock fails with error, or Context // Done channel is closed. TryLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) // Unlock is unlocks the file. Unlock() error }
Flock provides an interface to handle file locking. It defines an interface for the Flock type from github.com/gofrs/flock. Refer to https://pkg.go.dev/github.com/gofrs/flock?utm_source=godoc#Flock for documentation.
Click to show internal directories.
Click to hide internal directories.