registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package registry implements a simple HTTP client for Docker Registry

Package registry implements a simple HTTP client for Docker Registry

Index

Constants

View Source
const (
	// AuthClientID is the client ID used by the client created by GetV2AuthHTTPClient
	AuthClientID = "registryindexer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory interface {
	// GetTransport creates a new http.RoundTripper authenticated with a specific scope.
	// GetTransport is not memoized, and will create a new http.RoundTripper instance
	// every time.
	GetTransport(...auth.Scope) http.RoundTripper

	// GetRegistry creates a client.Registry. GetRegistry is memoized and safe to call
	// naively whenever needed.
	GetRegistry() (client.Registry, error)

	// GetRepository creates a distribution.Repository for a specific repository.
	// GetRepository is memoized and safe to call naively whenever needed.
	GetRepository(reference.Named) (distribution.Repository, error)
}

ClientFactory produces client.Registry and distribution.Repository instances while hiding authentication complexity

func NewClientFactory

func NewClientFactory(baseURL *url.URL, concurrency int, credentialStore auth.CredentialStore) (ClientFactory, error)

NewClientFactory produces a new ClientFactory

type Registry

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

Registry is a simple HTTP client for Docker Registry. This client only subset of the Docker Registry API endpoints.

func NewRegistry

func NewRegistry(baseURL *url.URL, prefixes []string, concurrency int, credentialStore auth.CredentialStore) (*Registry, error)

NewRegistry creates a new Registry client.

func (*Registry) GetCatalog

func (r *Registry) GetCatalog() ([]reference.Named, error)

GetCatalog returns a list of all repositories

func (*Registry) GetImage

func (r *Registry) GetImage(digest reference.Canonical) (*types.ImageInspect, error)

GetImage returns a specific blob from a repository

func (*Registry) GetImageFromTag

func (r *Registry) GetImageFromTag(tag reference.NamedTagged) (*types.ImageInspect, error)

GetImageFromTag returns a specific blob from a repository based on tag

func (*Registry) GetManifest

func (r *Registry) GetManifest(tagged reference.NamedTagged) (*schema2.Manifest, error)

GetManifest returns a schema for a specific tag for a specific repository

func (*Registry) GetTags

func (r *Registry) GetTags(repositoryName reference.Named) ([]reference.NamedTagged, error)

GetTags returns a list of all tags for a repository

func (*Registry) Hostname

func (r *Registry) Hostname() string

Jump to

Keyboard shortcuts

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