ecr

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 11 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, roleArn string, client ClientInterface) (ecrTypes.AuthorizationData, error)

func Initialize

func Initialize(logger logur.Logger)

Types

type ClientInterface added in v0.3.13

type ClientInterface interface {
	GetAuthorizationToken(ctx context.Context, input *ecr.GetAuthorizationTokenInput, _ ...func(*ecr.Options)) (*ecr.GetAuthorizationTokenOutput, error)
}

type StringableCredentials

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

func (*StringableCredentials) GetCreds added in v0.3.6

func (*StringableCredentials) Retrieve added in v0.3.6

func (StringableCredentials) String

func (c StringableCredentials) String() string

func (*StringableCredentials) ToAwsConfig added in v0.3.6

func (c *StringableCredentials) ToAwsConfig() aws.Config

type Token

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

func NewECRToken

func NewECRToken(ctx context.Context, creds StringableCredentials, client ClientInterface) (*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, client ClientInterface) (ecrTypes.AuthorizationData, error)

Jump to

Keyboard shortcuts

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