ecr

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthorizationToken

func GetAuthorizationToken(ctx context.Context, region string, credentials aws.Credentials) (ecr_types.AuthorizationData, error)

func Initialize

func Initialize(logger logur.Logger)

Types

type StringableCredentials

type StringableCredentials struct {
	aws.Credentials
	// Region specifies which region to connect to when using this credential
	Region string
}

func (StringableCredentials) String

func (c StringableCredentials) String() string

type Token

type Token struct {
	Creds                 StringableCredentials
	CurrentToken          *ecr_types.AuthorizationData
	TokenValidityDuration time.Duration
	LastQueriedAt         time.Time
}

func NewECRToken

func NewECRToken(ctx context.Context, creds StringableCredentials) (*Token, error)

func (*Token) Refresh

func (t *Token) Refresh(ctx context.Context) error

type TokenManager

type TokenManager struct {
	sync.Mutex
	ManagedTokens map[string]*Token
	Logger        logur.Logger
}

func NewECRTokenManager

func NewECRTokenManager(logger logur.Logger) *TokenManager

func (*TokenManager) GetAuthorizationToken

func (t *TokenManager) GetAuthorizationToken(ctx context.Context, key StringableCredentials) (ecr_types.AuthorizationData, error)

Jump to

Keyboard shortcuts

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