Documentation ¶
Index ¶
- func ParseRegistry(registry string) (accountId, awsEcrRegion string, ok bool)
- type Client
- func (c *Client) Login(ctx context.Context, autoLogin bool, image string) (authn.Authenticator, error)
- func (c *Client) LoginWithExpiry(ctx context.Context, autoLogin bool, image string) (authn.Authenticator, time.Time, error)
- func (c *Client) OIDCLogin(ctx context.Context, registryURL string) (authn.Authenticator, error)deprecated
- func (c *Client) WithConfig(cfg *aws.Config)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRegistry ¶ added in v0.11.0
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 ¶
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) WithConfig ¶ added in v0.17.0
WithConfig allows setting the client config if it's uninitialized.