registry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Registry Package adds the Possibility to talk with the (Docker) Registry API

Index

Constants

View Source
const (
	VUNK _RegistryVersion = "UNKNOWN" // Unknown Registry API Version

	V1 _RegistryVersion = "v1" // (Docker) Registry API Version v1
	V2 _RegistryVersion = "v2" // (Docker) Registry API Version v1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Required bool       // Is Authentication Required
	Cred     Credential // Needed Credentials
	// contains filtered or unexported fields
}

Registry Authentication Information

func (*Auth) Init

func (a *Auth) Init()

type BearerToken

type BearerToken struct {
	// The BearerToken is needed to communicate with the Registry API stored securely
	BearerToken *memguard.Enclave `json:"token"`

	// Date when the token expires as Unix timestamp
	ExpiresOn int64 `json:"expires_in"`
}

The BearerToken is needed to communicate with the Registry API

type Credential

type Credential struct {
	Username string            // Username
	Password *memguard.Enclave // Password stored securely
	Token    BearerToken       // The BearerToken is needed to communicate with the Registry API stored securely
	// contains filtered or unexported fields
}

Contains all Informations and Credentials needed to communicate with the Registry API

func (*Credential) Init

func (c *Credential) Init() error

noinspection GoNilnesss

type DockerRegistry

type DockerRegistry struct {
	Version        _RegistryVersion // API Version
	URI            string           // Registry URI
	Authentication Auth             // Authentication Informations and Credentials
	Repos          []Repository     // List of all Repos in the Registry
	// contains filtered or unexported fields
}

Holds all Informations that are needed to talk with the Registry API Implements the @registry Interface

func (*DockerRegistry) FetchAll

func (r *DockerRegistry) FetchAll() error

func (*DockerRegistry) Init

func (r *DockerRegistry) Init() error

noinspection GoNilness

func (*DockerRegistry) ListRepositories

func (r *DockerRegistry) ListRepositories() []Repository

noinspection GoNilness

func (*DockerRegistry) Stats

func (r *DockerRegistry) Stats() rt.Stats

type Image

type Image struct {
	Repository *Repository // Pointer to Parent Struct

	Name string   // Image Name (eg. 'nginx')
	Tags []rt.Tag // List of all available Tags
}

An Image represents a **single** Docker Image (with all Tags) Implements the @image Interface

func (*Image) DeleteSignature

func (i *Image) DeleteSignature(t *rt.Tag)

func (*Image) FetchAllTags

func (i *Image) FetchAllTags() error

noinspection ALL

func (*Image) GetName

func (i *Image) GetName() string

func (*Image) GetRegistryURI

func (i *Image) GetRegistryURI() string

func (*Image) GetTags

func (i *Image) GetTags() []rt.Tag

func (*Image) GetTagsPtr

func (i *Image) GetTagsPtr() *[]rt.Tag

func (*Image) ListImageTags

func (i *Image) ListImageTags() ([]rt.Tag, error)

func (*Image) SetTags

func (i *Image) SetTags(tags []rt.Tag)

type Repository

type Repository struct {
	DockerRegistry *DockerRegistry // Pointer to Parent Struct

	// A Repo can contain unlimited Sub-Repos (and Sub-Sub-Repos, Sub-Sub-Sub-Repos, ...)
	// For Example:
	// docker.io
	// |-- nginx						// nginx Image
	// |   `-- v1.0.0						// Image Version v1.0.0
	// `-- unstable/			// unstable Repo
	//     |-- samba					// samba Image
	//     |   |-- v1.0.0					// Image Version v1.0.0
	//     |   `-- v1.1.0					// Image Version v1.1.0
	//     `-- testing/			// testing Sub-Repo
	//         |-- jira					// jira Image
	//         |   |-- v1.0.0				// Image Version v1.0.0
	//         |   `-- v1.1.0				// Image Version v1.1.0
	//         `-- wiki					// wiki Image
	//             |-- v1.0.0				// Image Version v1.0.0
	//             `-- v2.0.0				// Image Version v2.0.0
	Name   string  // Name of the Repository (eg. 'stable')
	Images []Image // All
}

A (Docker) Repository is (for example) the 'atlassian-jira' in 'docker.reg.local/atlassian-jira:v1.0.0' or the 'testing/unstable' in 'docker.reg.local/testing/unstable/atlassian-jira:v2.0.0' Implements the @repository Interface

func (*Repository) FetchAllImages

func (r *Repository) FetchAllImages() error

func (*Repository) ListImages

func (r *Repository) ListImages() ([]Image, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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