registry

package
Version: v0.0.0-...-6c7e5b9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package registry provides domain abstractions over container registries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Credentials Credentials
	Logger      log.Logger
}

Client is a handle to a registry.

func (*Client) GetRepository

func (c *Client) GetRepository(repository string) (*Repository, error)

GetRepository yields a repository matching the given name, if any exists. Repository may be of various forms, in which case omitted elements take assumed defaults.

helloworld             -> index.docker.io/library/helloworld
foo/helloworld         -> index.docker.io/foo/helloworld
quay.io/foo/helloworld -> quay.io/foo/helloworld

type Credentials

type Credentials map[string]dockerregistry.Authenticator

Credentials to a (Docker) registry.

func CredentialsFromFile

func CredentialsFromFile(path string) (Credentials, error)

CredentialsFromFile returns a credentials object parsed from the given filepath.

func NoCredentials

func NoCredentials() Credentials

NoCredentials returns a usable but empty credentials object.

func (Credentials) For

For yields an authenticator for a specific host.

func (Credentials) Hosts

func (cs Credentials) Hosts() []string

Hosts returns all of the hosts available in these credentials.

type Image

type Image struct {
	Registry  string    // "quay.io:5000"
	Name      string    // "weaveworks/helloworld"
	Tag       string    // "master-59f0001"
	CreatedAt time.Time // Always UTC
}

Image represents a specific container image available in a repository. It's a struct because I think we can safely assume the data here is pretty universal across different registries and repositories.

func ParseImage

func ParseImage(image string) (i Image)

ParseImage splits the image string apart, returning an Image with as much info as we can gather.

func (Image) Repository

func (i Image) Repository() string

Repository returns a string with as much info as we have to rebuild the image repository (i.e. registry/name)

func (Image) String

func (i Image) String() string

String prints as much of an image as we have in the typical docker format. e.g. registry/name:tag

type Repository

type Repository struct {
	Name   string // "quay.io:5000/weaveworks/helloworld"
	Images []Image
}

Repository is a collection of images with the same registry and name (e.g,. "quay.io:5000/weaveworks/helloworld") but not the same tag (e.g., "quay.io:5000/weaveworks/helloworld:v0.1").

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL