docker

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	DockerClient *client.Client
	Logger       *log.Logger
}

Client is a Docker client with a logger

func NewClient

func NewClient(logger *log.Logger) (Client, error)

NewClient returns a new Docker client

func (Client) GetAllDigestsOnHost

func (c Client) GetAllDigestsOnHost(ctx context.Context) ([]string, error)

GetAllDigestsOnHost gets all of the images and their digests on the host

func (Client) GetAllImagesOnHost

func (c Client) GetAllImagesOnHost(ctx context.Context) ([]string, error)

GetAllImagesOnHost gets all of the images and their tags on the host

func (Client) GetTagsForRepo

func (c Client) GetTagsForRepo(ctx context.Context, host string, repository string) ([]string, error)

GetTagsForRepo returns all of the tags for a given repository

func (Client) ImageExistsAtRemote

func (c Client) ImageExistsAtRemote(ctx context.Context, image string) (bool, error)

ImageExistsAtRemote returns true if the image exists at the remote registry

func (Client) ImageExistsOnHost

func (c Client) ImageExistsOnHost(ctx context.Context, image string) (bool, error)

ImageExistsOnHost returns true if the image exists on the host machine

func (Client) PullImageAndWait

func (c Client) PullImageAndWait(ctx context.Context, image string, auth string) error

PullImageAndWait pulls an image and waits for it to finish pulling

func (Client) PushImageAndWait

func (c Client) PushImageAndWait(ctx context.Context, image string, auth string) error

PushImageAndWait pushes an image and waits for it to finish pushing

type ErrorMessage

type ErrorMessage struct {
	Error string `json:"error"`
}

ErrorMessage is an error message from the Docker client

type ProgressDetail

type ProgressDetail struct {
	Current int
	Total   int
}

ProgressDetail is the current state of pushing or pulling an image (in Bytes)

type RegistryPath

type RegistryPath string

RegistryPath is a registry path for a docker image

func (RegistryPath) Digest

func (r RegistryPath) Digest() string

Digest is the digest in the registry path, if one exists

func (RegistryPath) Host

func (r RegistryPath) Host() string

Host is the host in the registry path

func (RegistryPath) Repository

func (r RegistryPath) Repository() string

Repository is the repository in the registry path

func (RegistryPath) Tag

func (r RegistryPath) Tag() string

Tag is the tag in the registry path, if one exists

type Status

type Status struct {
	Message        string         `json:"status"`
	ID             string         `json:"id"`
	ProgressDetail ProgressDetail `json:"progressDetail"`
}

Status is the status output from the Docker client

func (Status) GetMessage

func (s Status) GetMessage() string

GetMessage returns a human friendly message from parsing the status message

Jump to

Keyboard shortcuts

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