dockerregistry

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthTransport

func NewAuthTransport(inner http.RoundTripper) http.RoundTripper

NewAuthTransport returns a roundtripper that does bearer/etc authentication

func ResolveImage

func ResolveImage(image string) (string, error)

ResolveImage loads the digest reference for a docker image.

Types

type DefaultResolverClient

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

DefaultResolverClient resolves digests for a docker image.

func NewDefaultDigester

func NewDefaultDigester() *DefaultResolverClient

NewDefaultDigester creates an instance of DefaultDigester.

func (*DefaultResolverClient) ManifestV2Digest

func (d *DefaultResolverClient) ManifestV2Digest(image string) (string, error)

ManifestV2Digest returns the 'Docker-Content-Digest' field of the the header when making a request to the v2 manifest.

type ImageName

type ImageName struct {
	// Registry is the registry api address
	Registry string
	// Repository is the repository name
	Repository string
	// Name is the name of the image
	Name string
	// Tag is the image tag
	Tag string
	// Digest is the image digest
	Digest string
}

ImageName represents the parts of a docker image name eg: "myregistryhost:5000/fedora/httpd:version1.0"

func ParseImageName

func ParseImageName(image string) (ImageName, error)

ParseImageName parses a docker image into an ImageName struct

func (ImageName) RegistryRepoName

func (n ImageName) RegistryRepoName() string

RegistryRepoName returns the "repository" as used in the registry URL

func (ImageName) RegistryURL

func (n ImageName) RegistryURL() string

RegistryURL returns the deduced base URL of the registry for this image

func (ImageName) String

func (n ImageName) String() string

String implements the Stringer interface

type Registry

type Registry struct {
	URL    string
	Client *http.Client
}

Registry is a *crazy limited* Docker registry client.

func NewRegistryClient

func NewRegistryClient(client *http.Client, url string) *Registry

NewRegistryClient creates a new Registry client using the given http client and base URL.

func (*Registry) ManifestDigest

func (r *Registry) ManifestDigest(reponame, tag string) (string, error)

ManifestDigest fetches the manifest digest for a given reponame and tag.

type Resolver

type Resolver interface {
	Resolve(image *ImageName) error
}

Resolver is able to resolve docker image names into more specific forms

type ResolverClient

type ResolverClient interface {
	ManifestV2Digest(image string) (string, error)
}

ResolverClient is client resolves data from manifests.

Jump to

Keyboard shortcuts

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