aws

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRegistry added in v0.11.0

func ParseRegistry(registry string) (accountId, awsEcrRegion string, ok bool)

ParseRegistry returns the AWS account ID and region and `true` if the image registry/repository is hosted in AWS's Elastic Container Registry, otherwise empty strings and `false`.

Types

type Client

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

Client is a AWS ECR client which can log into the registry and return authorization information.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new empty ECR client. NOTE: In order to avoid breaking the auth API with aws-sdk-go-v2's default config, return an empty Client. Client.getLoginAuth() loads the default config if Client.config is nil. This also enables tests to configure the Client with stub before calling the login method using Client.WithConfig().

func (*Client) Login

func (c *Client) Login(ctx context.Context, autoLogin bool, image string) (authn.Authenticator, error)

Login attempts to get the authentication material for ECR.

func (*Client) LoginWithExpiry added in v0.38.0

func (c *Client) LoginWithExpiry(ctx context.Context, autoLogin bool, image string) (authn.Authenticator, time.Time, error)

LoginWithExpiry attempts to get the authentication material for ECR. It returns the authentication material and the expiry time of the token.

func (*Client) OIDCLogin deprecated added in v0.27.0

func (c *Client) OIDCLogin(ctx context.Context, registryURL string) (authn.Authenticator, error)

OIDCLogin attempts to get the authentication material for ECR.

Deprecated: Use LoginWithExpiry instead.

func (*Client) WithConfig added in v0.17.0

func (c *Client) WithConfig(cfg *aws.Config)

WithConfig allows setting the client config if it's uninitialized.

type Option added in v0.41.0

type Option func(*Client)

Option is a functional option for configuring the client.

func WithProxyURL added in v0.41.0

func WithProxyURL(proxyURL *url.URL) Option

WithProxyURL sets the proxy URL for the client.

Jump to

Keyboard shortcuts

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