registry

package
v0.0.0-...-19a9f39 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Username string
	Password string
}

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Auth     string `json:"auth"`
}

Credentials is a structure to unmarshall .dockercfg data

type Registry

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

Registry is a docker registry with `Name` and private `credentials`

func NewRegistry

func NewRegistry(name string, credentials *Credentials) (r *Registry, err error)

NewRegistry create a new registry with given name and credentials and configure http client

func (*Registry) Get

func (r *Registry) Get(pathTemplate string, args ...interface{}) (response *http.Response, err error)

Get makes GET API call for given path with auth headers

func (*Registry) GetHost

func (r *Registry) GetHost() string

GetHost return the registry's host for API requests

func (*Registry) GetTags

func (r *Registry) GetTags(repo string) (tags []string, err error)

GetTags returns list of tags for the image repository

type RegistryList

type RegistryList struct {
	Items []*Registry
}

func GetRegistries

func GetRegistries(k *client.Client, deployment *ext.Deployment) (registries *RegistryList, err error)

GetRegistries returns list of registries based on deployment's image pull secrets

func (*RegistryList) Get

func (list *RegistryList) Get(name string) (r *Registry, err error)

Get returns a registry with the given name from the list

type Repository

type Repository struct {
	Name     string
	Registry *Registry
}

Repository is an image repository in a registry

func NewRepository

func NewRepository(image string, registry *Registry) *Repository

NewRepository return a new Repository for given image name

func (*Repository) GetLatestVersion

func (r *Repository) GetLatestVersion(filter semver.Range) (version *Version, err error)

GetLatestVersion returns the latest image version based on tag

type TagsList

type TagsList struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

TagList is a get tags API call response

type Version

type Version struct {
	Tag    string
	Semver semver.Version
}

Image version with repository tag and semver representation. `Tag` shoulf be used to get image by its tag. `Semver` is for version compare. TODO make it consistent, changing one field should affect another

func NewVersion

func NewVersion(tag string) (version *Version, err error)

NewVersion return association for image tag and its semver

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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