api

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	ProxyEndpoint string
	Username      string
	Password      string
}

Auth credentials returned by ECR service to allow docker login

type Client

type Client interface {
	GetCredentials(serverURL string) (*Auth, error)
	GetCredentialsByRegistryID(registryID string) (*Auth, error)
	ListCredentials() ([]*Auth, error)
}

Client used for calling ECR service

type ClientFactory

type ClientFactory interface {
	NewClient(awsConfig aws.Config) Client
	NewClientWithOptions(opts Options) Client
	NewClientFromRegion(region string) Client
	NewClientWithFipsEndpoint(region string) (Client, error)
	NewClientWithDefaults() Client
}

ClientFactory is a factory for creating clients to interact with ECR

type DefaultClientFactory

type DefaultClientFactory struct{}

DefaultClientFactory is a default implementation of the ClientFactory

func (DefaultClientFactory) NewClient

func (defaultClientFactory DefaultClientFactory) NewClient(awsConfig aws.Config) Client

NewClient Create new client with AWS Config

func (DefaultClientFactory) NewClientFromRegion

func (defaultClientFactory DefaultClientFactory) NewClientFromRegion(region string) Client

NewClientFromRegion uses the region to create the client

func (DefaultClientFactory) NewClientWithDefaults

func (defaultClientFactory DefaultClientFactory) NewClientWithDefaults() Client

NewClientWithDefaults creates the client and defaults region

func (DefaultClientFactory) NewClientWithFipsEndpoint

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) NewClientWithOptions

func (defaultClientFactory DefaultClientFactory) NewClientWithOptions(opts Options) Client

NewClientWithOptions Create new client with Options

type ECRAPI

type ECRAPI interface {
	GetAuthorizationToken(context.Context, *ecr.GetAuthorizationTokenInput, ...func(*ecr.Options)) (*ecr.GetAuthorizationTokenOutput, error)
}

type ECRPublicAPI

type ECRPublicAPI interface {
	GetAuthorizationToken(context.Context, *ecrpublic.GetAuthorizationTokenInput, ...func(*ecrpublic.Options)) (*ecrpublic.GetAuthorizationTokenOutput, error)
}

type Options

type Options struct {
	Config   aws.Config
	CacheDir string
}

Options makes the constructors more configurable

type Registry

type Registry struct {
	Service Service
	ID      string
	FIPS    bool
	Region  string
}

Registry in ECR

func ExtractRegistry

func ExtractRegistry(input string) (*Registry, error)

ExtractRegistry returns the ECR registry behind a given service endpoint

type Service

type Service string
const (
	ServiceECR       Service = "ecr"
	ServiceECRPublic Service = "ecr-public"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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