aws

package
v0.0.0-...-9f0a716 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AWSCredentialsExpiry = 2 * time.Hour

AWSCredentialsExpiry specifies how long can we keep cached AWS credentials. This is required to reduce chance of hiting rate limits, more info here: https://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache - internal cache for aws

func NewCache

func NewCache(ttl time.Duration) *Cache

NewCache - new credentials cache

func (*Cache) Get

func (c *Cache) Get(registry string) (*types.Credentials, error)

Get - retrieves creds

func (*Cache) Put

func (c *Cache) Put(registry string, creds *types.Credentials)

Put - saves new creds

type CredentialsHelper

type CredentialsHelper struct {
	// contains filtered or unexported fields
}

CredentialsHelper provides authorization to ECR. Authentication details: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ # Access Key ID AWS_ACCESS_KEY_ID=AKID AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. more on auth: https://stackoverflow.com/questions/41544554/how-to-run-aws-sdk-with-credentials-from-variables

func New

func New() *CredentialsHelper

New creates a new instance of aws credentials helper

func (*CredentialsHelper) GetCredentials

func (h *CredentialsHelper) GetCredentials(image *types.TrackedImage) (*types.Credentials, error)

GetCredentials - finds credentials

func (*CredentialsHelper) IsEnabled

func (h *CredentialsHelper) IsEnabled() bool

IsEnabled returns a bool whether this credentials helper is initialised or not

Jump to

Keyboard shortcuts

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