...

Package cache

import "github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache"
Overview
Index
Subdirectories

Overview ▾

type AuthEntry

type AuthEntry struct {
    AuthorizationToken string
    RequestedAt        time.Time
    ExpiresAt          time.Time
    ProxyEndpoint      string
    Service            Service
}

func (*AuthEntry) IsValid

func (authEntry *AuthEntry) IsValid(testTime time.Time) bool

IsValid checks if AuthEntry is still valid at testTime. AuthEntries expire at 1/2 of their original requested window.

type CredentialsCache

type CredentialsCache interface {
    Get(registry string) *AuthEntry
    GetPublic() *AuthEntry
    Set(registry string, entry *AuthEntry)
    List() []*AuthEntry
    Clear()
}

func BuildCredentialsCache

func BuildCredentialsCache(config aws.Config, cacheDir string) CredentialsCache

func NewFileCredentialsCache

func NewFileCredentialsCache(path string, filename string, cachePrefixKey string, publicCacheKey string) CredentialsCache

NewFileCredentialsCache returns a new file credentials cache.

path is used for temporary files during save, and filename should be a relative filename in the same directory where the cache is serialized and deserialized.

cachePrefixKey is used for scoping credentials for a given credential cache (i.e. region and accessKey).

func NewNullCredentialsCache

func NewNullCredentialsCache() CredentialsCache

type RegistryCache

type RegistryCache struct {
    Registries map[string]*AuthEntry
    Version    string
}

type Service

type Service string
const (
    ServiceECR       Service = "ecr"
    ServiceECRPublic Service = "ecr-public"
)

Subdirectories

Name Synopsis
..
mocks