Auth credentials returned by ECR service to allow docker login
type Auth struct { ProxyEndpoint string Username string Password string }
Client used for calling ECR service
type Client interface { GetCredentials(serverURL string) (*Auth, error) GetCredentialsByRegistryID(registryID string) (*Auth, error) ListCredentials() ([]*Auth, error) }
ClientFactory is a factory for creating clients to interact with ECR
type ClientFactory interface { NewClient(awsConfig aws.Config) Client NewClientWithOptions(opts Options) Client NewClientFromRegion(region string) Client NewClientWithFipsEndpoint(region string) (Client, error) NewClientWithDefaults() Client }
DefaultClientFactory is a default implementation of the ClientFactory
type DefaultClientFactory struct{}
func (defaultClientFactory DefaultClientFactory) NewClient(awsConfig aws.Config) Client
NewClient Create new client with AWS Config
func (defaultClientFactory DefaultClientFactory) NewClientFromRegion(region string) Client
NewClientFromRegion uses the region to create the client
func (defaultClientFactory DefaultClientFactory) NewClientWithDefaults() Client
NewClientWithDefaults creates the client and defaults region
func (defaultClientFactory DefaultClientFactory) NewClientWithFipsEndpoint(region string) (Client, error)
NewClientWithFipsEndpoint overrides the default ECR service endpoint in a given region to use the FIPS endpoint
func (defaultClientFactory DefaultClientFactory) NewClientWithOptions(opts Options) Client
NewClientWithOptions Create new client with Options
type ECRAPI interface { GetAuthorizationToken(context.Context, *ecr.GetAuthorizationTokenInput, ...func(*ecr.Options)) (*ecr.GetAuthorizationTokenOutput, error) }
type ECRPublicAPI interface { GetAuthorizationToken(context.Context, *ecrpublic.GetAuthorizationTokenInput, ...func(*ecrpublic.Options)) (*ecrpublic.GetAuthorizationTokenOutput, error) }
Options makes the constructors more configurable
type Options struct { Config aws.Config CacheDir string }
Registry in ECR
type Registry struct { Service Service ID string FIPS bool Region string }
func ExtractRegistry(input string) (*Registry, error)
ExtractRegistry returns the ECR registry behind a given service endpoint
type Service string
const ( ServiceECR Service = "ecr" ServiceECRPublic Service = "ecr-public" )