commands

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultCommand

func NewDefaultCommand() *cobra.Command

NewDefaultCommand creates a new default command

func WriteManifest added in v0.7.0

func WriteManifest(manifest Manifest) error

WriteManifest writes the image manifest to disk

Types

type Auth

type Auth struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

Auth is a username and password to log into a registry

type Client added in v0.8.0

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

Client is a Docker client with a logger

func NewClient added in v0.8.0

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

NewClient returns a new Docker client

func (Client) PullImage added in v0.8.0

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

PullImage pulls a Docker image

func (Client) PushImage added in v0.8.0

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

PushImage pushes a Docker image

type Manifest added in v0.7.0

type Manifest struct {
	Target Target        `yaml:"target"`
	Images []SourceImage `yaml:"sources,omitempty"`
}

Manifest is a collection of images to sync

func GetManifest added in v0.7.0

func GetManifest() (Manifest, error)

GetManifest returns the current manifest file in the working directory

func NewAutodetectManifest added in v0.7.0

func NewAutodetectManifest(target string, path string) (Manifest, error)

NewAutodetectManifest returns a new image manifest with images found in the repository

func NewManifest added in v0.7.0

func NewManifest(target string) Manifest

NewManifest returns a new image manifest

type Path added in v0.8.0

type Path string

Path is a registry host and repository

func (Path) Host added in v0.8.0

func (p Path) Host() string

Host is the host of the registry

func (Path) Repository added in v0.8.0

func (p Path) Repository() string

Repository is the repository of the registry

func (Path) String added in v0.8.0

func (p Path) String() string

type SourceImage added in v0.8.0

type SourceImage struct {
	Repository string `yaml:"repository"`
	Host       string `yaml:"host,omitempty"`
	Target     Target `yaml:"target,omitempty"`
	Tag        string `yaml:"tag,omitempty"`
	Auth       Auth   `yaml:"auth,omitempty"`
}

SourceImage is a source container image

func (SourceImage) String added in v0.8.0

func (c SourceImage) String() string

String returns the source image including its tag

func (SourceImage) TargetImage added in v0.8.0

func (c SourceImage) TargetImage() string

TargetImage returns the target image includes its tag

type Target

type Target struct {
	Host       string `yaml:"host,omitempty"`
	Repository string `yaml:"repository,omitempty"`
	Auth       Auth   `yaml:"auth,omitempty"`
}

Target is a target location for an image

func (Target) String

func (t Target) String() string

Jump to

Keyboard shortcuts

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