Documentation ¶
Overview ¶
Package client provides Docker registry client API
Index ¶
- Constants
- Variables
- type Config
- type RegistryClient
- func (cli *RegistryClient) IsLoggedIn() bool
- func (cli *RegistryClient) Login(username, password string) error
- func (cli *RegistryClient) Ping() error
- func (cli *RegistryClient) Tag(repoPath, tagName string, tagManifest manifest.Manifest) (*tag.Tag, error)
- func (cli *RegistryClient) TagData(repoPath string) ([]string, map[string]manifest.Manifest, error)
- func (cli *RegistryClient) URL() string
Constants ¶
const MaxConcurrentRequests = 256
MaxConcurrentRequests is a hard limit for simultaneous registry requests
Variables ¶
var DefaultConcurrentRequests = 16
DefaultConcurrentRequests will be used if no explicit ConcurrentRequests configured
var DefaultRetryDelay = 2 * time.Second
DefaultRetryDelay will be used if no explicit RetryDelay configured
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ConcurrentRequests defines how much requests to registry we could run concurrently ConcurrentRequests int // WaitBetween defines how much we will wait between batches of requests WaitBetween time.Duration // RetryRequests defines how much retries we will do to the failed HTTP request RetryRequests int // RetryDelay defines how much we will wait between failed HTTP request and retry RetryDelay time.Duration // TraceRequests sets if we will print out registry HTTP request traces TraceRequests bool // IsInsecure sets if we want to communicate registry over plain HTTP instead of HTTPS IsInsecure bool }
Config has configuration parameters for RegistryClient creation
type RegistryClient ¶
type RegistryClient struct { // Config has general configuration of the registry client instance Config Config // Token is an authentication token obtained after registry login Token auth.Token // RepoTokens are per-repo tokens (make sense for "Bearer" authentication only) RepoTokens map[string]auth.Token // contains filtered or unexported fields }
RegistryClient is an abstraction to wrap logic of working with Docker registry incl. connection, authentification, authorization, obtaining information etc...
func New ¶
func New(registry string, config Config) (*RegistryClient, error)
New creates and validates new RegistryClient instance
func (*RegistryClient) IsLoggedIn ¶
func (cli *RegistryClient) IsLoggedIn() bool
IsLoggedIn indicates if we are logged in to registry or not
func (*RegistryClient) Login ¶
func (cli *RegistryClient) Login(username, password string) error
Login logs in to the registry (returns error, if failed)
func (*RegistryClient) Ping ¶
func (cli *RegistryClient) Ping() error
Ping checks basic connectivity to the registry
func (*RegistryClient) Tag ¶
func (cli *RegistryClient) Tag(repoPath, tagName string, tagManifest manifest.Manifest) (*tag.Tag, error)
Tag gets information about specified repository tag
func (*RegistryClient) TagData ¶ added in v1.2.5
TagData gets list of all tag names and all additional data for the repository path specified
func (*RegistryClient) URL ¶
func (cli *RegistryClient) URL() string
URL formats a valid URL for the V2 registry