cache

package
v0.0.0-...-2b9fe9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL