Documentation
¶
Index ¶
- Variables
- func ExtractTagNames(tags []Tag) []string
- func GetAuthFromFile(registry string) (string, string)
- func GetAuthTokens() (map[string]string, error)
- func UnmarshalAuth(auth string) (string, string)
- type Client
- func (c *Client) Host() string
- func (c *Client) Image(ctx context.Context, repo, tag string) (img *Image, err error)
- func (c *Client) Repos(ctx context.Context, opts *ListRepoOptions) ([]Repository, error)
- func (c *Client) ReposChan(ctx context.Context, opts *ListRepoOptions) (chan Repository, error)
- func (c *Client) Tags(ctx context.Context, repo string, opts *ListTagOptions) ([]Tag, error)
- type Image
- type ImageHistory
- type ImageSize
- type ListRepoOptions
- type ListTagOptions
- type Registry
- type Repository
- type Tag
Constants ¶
This section is empty.
Variables ¶
var DEBUG bool
DEBUG enables debug output
Functions ¶
func ExtractTagNames ¶
ExtractTagNames returns the names of the []Tags
func GetAuthFromFile ¶
GetAuthFromFile returns the username, password of that registry from the config file ($HOME/.docker/config.json)
func GetAuthTokens ¶
GetAuthTokens from $HOME/.docker/config.json
func UnmarshalAuth ¶
UnmarshalAuth returns the username and password for that auth credential
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents for a docker registry client
func (*Client) Repos ¶
func (c *Client) Repos(ctx context.Context, opts *ListRepoOptions) ([]Repository, error)
func (*Client) ReposChan ¶
func (c *Client) ReposChan(ctx context.Context, opts *ListRepoOptions) (chan Repository, error)
type Image ¶
Image instance, includes the schemav1 and schemav2
func (*Image) History ¶
func (i *Image) History() []ImageHistory
History converts the v1's history info to reglib's history struct
func (*Image) Layers ¶
func (i *Image) Layers() []dis.Descriptor
Layers returns the layer info (schemav2)
type ImageHistory ¶
type ImageHistory struct {
Architecture string `json:"architecture,omitempty"`
Config struct {
Hostname string `json:"Hostname,omitempty"`
Domainname string `json:"Domainname,omitempty"`
User string `json:"User,omitempty"`
AttachStdin bool `json:"AttachStdin,omitempty"`
AttachStdout bool `json:"AttachStdout,omitempty"`
AttachStderr bool `json:"AttachStderr,omitempty"`
Tty bool `json:"Tty,omitempty"`
OpenStdin bool `json:"OpenStdin,omitempty"`
StdinOnce bool `json:"StdinOnce,omitempty"`
Env []string `json:"Env,omitempty"`
Cmd []string `json:"Cmd,omitempty"`
ArgsEscaped bool `json:"ArgsEscaped,omitempty"`
Image string `json:"Image,omitempty"`
Volumes interface{} `json:"Volumes,omitempty"`
WorkingDir string `json:"WorkingDir,omitempty"`
Entrypoint interface{} `json:"Entrypoint,omitempty"`
OnBuild interface{} `json:"OnBuild,omitempty"`
Labels interface{} `json:"Labels,omitempty"`
} `json:"config,omitempty"`
Container string `json:"container,omitempty"`
ContainerConfig struct {
Hostname string `json:"Hostname,omitempty"`
Domainname string `json:"Domainname,omitempty"`
User string `json:"User,omitempty"`
AttachStdin bool `json:"AttachStdin,omitempty"`
AttachStdout bool `json:"AttachStdout,omitempty"`
AttachStderr bool `json:"AttachStderr,omitempty"`
Tty bool `json:"Tty,omitempty"`
OpenStdin bool `json:"OpenStdin,omitempty"`
StdinOnce bool `json:"StdinOnce,omitempty"`
Env []string `json:"Env,omitempty"`
Cmd []string `json:"Cmd,omitempty"`
ArgsEscaped bool `json:"ArgsEscaped,omitempty"`
Image string `json:"Image,omitempty"`
Volumes interface{} `json:"Volumes,omitempty"`
WorkingDir string `json:"WorkingDir,omitempty"`
Entrypoint interface{} `json:"Entrypoint,omitempty"`
OnBuild interface{} `json:"OnBuild,omitempty"`
Labels struct {
} `json:"Labels,omitempty"`
} `json:"container_config,omitempty"`
Created time.Time `json:"created,omitempty"`
DockerVersion string `json:"docker_version,omitempty"`
ID string `json:"id,omitempty"`
Os string `json:"os,omitempty"`
Parent string `json:"parent,omitempty"`
Throwaway bool `json:"throwaway,omitempty"`
}
ImageHistory converted from json, thanks to https://mholt.github.io/json-to-go/
type ListRepoOptions ¶
ListRepoOptions ...
type ListTagOptions ¶
ListTagOptions ...
type Registry ¶
type Registry interface {
// Repos list the repositories
Repos(ctx context.Context, opts *ListRepoOptions) ([]Repository, error)
// ReposChan returns a channel contains the repos
ReposChan(ctx context.Context, opts *ListRepoOptions) (chan Repository, error)
// Tags list the tags of the repository
Tags(ctx context.Context, repo string, opts *ListTagOptions) ([]Tag, error)
// Image get the image instance via the specific repo and tag
Image(ctx context.Context, repo, tag string) (*Image, error)
// return the registry's host (domain)
Host() string
}
Registry is the interface of registry client
func NewFromConfigFile ¶
NewFromConfigFile ...
type Repository ¶
Repository is the instance of an repo
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
download
command
|
|
|
list-repos
command
|
|
|
registry-tree
command
|
|
|
watch
command
|