v1

package
v0.0.0-...-7a50bc8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

v1 is a Docker v1 Registry API client implementation. The v1 API has been deprecated by the public Docker Hub as of December 7th, 2015.

See: https://docs.docker.com/v1.6/reference/api/registry_api/

Index

Constants

This section is empty.

Variables

View Source
var (
	// DockerHubRegistryURL points to the official Docker registry.
	DockerHubRegistryURL = "https://index.docker.io"
)

Functions

This section is empty.

Types

type Image

type Image struct {
	Name string
	// contains filtered or unexported fields
}

Image is a Docker image info (constructed from Docker API response).

func GetImage

func GetImage(name, registryURL string) (*Image, int, error)

GetImage fetches Docker repository information from the specified Docker registry. If the registry is an empty string it defaults to the DockerHub. The integer return value is the status code of the HTTP response.

func (*Image) AuthorizationHeader

func (i *Image) AuthorizationHeader() string

AuthorizationHeader exposes the authorization header created for the image for external layer downloads.

func (*Image) Cookie

func (i *Image) Cookie(u string) (string, error)

Cookie returns the string representation of the first cookie stored in stored client's cookie jar.

func (*Image) History

func (i *Image) History(tagName string) ([]string, error)

History returns an ordered list of layers that make up Docker. The order is reverse, it goes from the latest layer to the base layer. Client can iterate these layers and download them using LayerReader.

func (*Image) LayerReader

func (i *Image) LayerReader(id string) (io.ReadCloser, error)

LayerReader returns io.ReadCloser that can be used to read Docker layer data.

func (*Image) LayerURLs

func (i *Image) LayerURLs(id string) []string

LayerURLs returns several URLs for a specific layer.

func (*Image) Metadata

func (i *Image) Metadata(tagName string, v interface{}) error

Metadata unmarshals a Docker image metadata into provided 'v' interface.

func (*Image) TagLayerID

func (i *Image) TagLayerID(tagName string) (string, error)

TagLayerID returns a layer ID for a given tag.

func (*Image) Tags

func (i *Image) Tags() []string

Tags returns a list of tags available for image

Jump to

Keyboard shortcuts

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