internal

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitProvider

func InitProvider(c Initializer) error

InitProvider does some initialization steps for a provider.

func NewBase

func NewBase(repoDetails docker.ImageRepoDetails, transport http.RoundTripper) *baseClient

NewBase creates a new base provider.

func Providers

Providers returns all the supported registry providers.

Types

type APIVersion

type APIVersion string

APIVersion is the API version type.

const (
	// APIVersionV1 is the API version v1.
	APIVersionV1 APIVersion = "v1"
	// APIVersionV2 is the API version v2.
	APIVersionV2 APIVersion = "v2"
)

func (APIVersion) String

func (v APIVersion) String() string

type ArchitectureGetter

type ArchitectureGetter interface {
	GetManifests(imageName, tag string) (*ManifestsResult, error)
	GetBlobs(imageName, digest string) (*BlobsResponse, error)
}

ArchitectureGetter defines manifests and blob APIs.

type BlobsResponse

type BlobsResponse struct {
	Architecture string `json:"architecture"`
}

BlobsResponse is the result of GetBlobs.

type ECRInterface

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

type Initializer

type Initializer interface {
	WrapTransport(...TransportWrapper) error
	DecideBaseURL() error
}

Initializer provides methods for initializing the registry client.

type ManifestsResult

type ManifestsResult struct {
	Architecture string
	Digest       string
}

ManifestsResult is the result of GetManifests.

type Matcher

type Matcher interface {
	Match() bool
}

Matcher provides a method for selecting which registry client to use.

type Registry

type Registry interface {
	Tags(string) (tools.Versions, error)
	GetArchitecture(imageName, tag string) (string, error)
	Close() error
	Ping() error
	ImageRepoDetails() docker.ImageRepoDetails
	ShouldRefreshAuth() (bool, *time.Duration)
	RefreshAuth() error
}

Registry provides APIs to interact with the OCI provider client.

type RegistryInternal

type RegistryInternal interface {
	Matcher
	Registry
	Initializer
}

RegistryInternal provides methods of registry clients for internal operations. It's exported for generating mocks for tests.

type TransportWrapper

type TransportWrapper func(http.RoundTripper, *docker.ImageRepoDetails) (http.RoundTripper, error)

TransportWrapper wraps RoundTripper.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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