Documentation ¶
Overview ¶
Registry Package adds the Possibility to talk with the (Docker) Registry API
Index ¶
- Constants
- type Auth
- type BearerToken
- type Credential
- type DockerRegistry
- type Image
- func (i *Image) DeleteSignature(t *rt.Tag)
- func (i *Image) FetchAllTags() error
- func (i *Image) GetName() string
- func (i *Image) GetRegistryURI() string
- func (i *Image) GetTags() []rt.Tag
- func (i *Image) GetTagsPtr() *[]rt.Tag
- func (i *Image) ListImageTags() ([]rt.Tag, error)
- func (i *Image) SetTags(tags []rt.Tag)
- type Repository
Constants ¶
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
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
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) 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 (*Image) GetRegistryURI ¶
func (*Image) GetTagsPtr ¶
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)