v0.0.0-...-605ff4a Latest Latest

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

Go to latest
Published: Sep 25, 2013 License: Apache-2.0 Imports: 14 Imported by: 0




This section is empty.


View Source
var ErrAlreadyExists = errors.New("Image already exists")
View Source
var ErrInvalidRepositoryName = errors.New("Invalid repository name (ex: \"registry.domain.tld/myrepos\")")


func ResolveRepositoryName

func ResolveRepositoryName(reposName string) (string, string, error)

Resolves a repository name to a endpoint + name


type ImgData

type ImgData struct {
	ID       string `json:"id"`
	Checksum string `json:"checksum,omitempty"`
	Tag      string `json:",omitempty"`

type Registry

type Registry struct {
	// contains filtered or unexported fields

func NewRegistry

func NewRegistry(root string, authConfig *auth.AuthConfig, baseVersions ...VersionInfo) (r *Registry, err error)

func (*Registry) GetAuthConfig

func (r *Registry) GetAuthConfig(withPasswd bool) *auth.AuthConfig

func (*Registry) GetRemoteHistory

func (r *Registry) GetRemoteHistory(imgID, registry string, token []string) ([]string, error)

Retrieve the history of a given image from the Registry. Return a list of the parent's json (requested image included)

func (*Registry) GetRemoteImageJSON

func (r *Registry) GetRemoteImageJSON(imgID, registry string, token []string) ([]byte, int, error)

Retrieve an image from the Registry.

func (*Registry) GetRemoteImageLayer

func (r *Registry) GetRemoteImageLayer(imgID, registry string, token []string) (io.ReadCloser, error)

func (*Registry) GetRemoteTags

func (r *Registry) GetRemoteTags(registries []string, repository string, token []string) (map[string]string, error)

func (*Registry) GetRepositoryData

func (r *Registry) GetRepositoryData(indexEp, remote string) (*RepositoryData, error)

func (*Registry) LookupRemoteImage

func (r *Registry) LookupRemoteImage(imgID, registry string, token []string) bool

Check if an image exists in the Registry

func (*Registry) PushImageJSONIndex

func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData, validate bool, regs []string) (*RepositoryData, error)

func (*Registry) PushImageJSONRegistry

func (r *Registry) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, registry string, token []string) error

Push a local image to the registry

func (*Registry) PushImageLayerRegistry

func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registry string, token []string) error

func (*Registry) PushRegistryTag

func (r *Registry) PushRegistryTag(remote, revision, tag, registry string, token []string) error

push a tag on the registry. Remote has the format '<user>/<repo>

func (*Registry) SearchRepositories

func (r *Registry) SearchRepositories(term string) (*SearchResults, error)

type RepositoryData

type RepositoryData struct {
	ImgList   map[string]*ImgData
	Endpoints []string
	Tokens    []string

type SearchResults

type SearchResults struct {
	Query      string              `json:"query"`
	NumResults int                 `json:"num_results"`
	Results    []map[string]string `json:"results"`

type VersionInfo

type VersionInfo interface {
	Name() string
	Version() string

VersionInfo is used to model entities which has a version. It is basically a tupple with name and version.

Jump to

Keyboard shortcuts

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