Documentation
¶
Index ¶
- Constants
- func PullImages(cl Client, images []*Image) (<-chan Image, <-chan ErrPullImage, <-chan struct{})
- func PushImages(cl Client, images []*Image) []error
- func RetagImages(cl Client, pairs []ImageTagPair) (<-chan ImageTagPair, <-chan ErrTag, <-chan struct{})
- type Client
- type ErrInvalidImageName
- type ErrPullImage
- type ErrTag
- type Image
- func ParseImageFromName(name string) (*Image, error)
- func ParseImageFromRepoAndSha(dockerRegistries []string, dockerRegistryOrg string, ras git.RepoAndSha) ([]*Image, error)
- func ParseImagesFromRepoAndShaList(dockerRegistries []string, dockerRegistryOrg string, rasl *git.RepoAndShaList) ([]*Image, error)
- type ImageTagPair
- type MemoryClient
Constants ¶
const ( // DeisCIDockerOrg represents the "deisci" docker organization on quay and the docker hub DeisCIDockerOrg = "deisci" // DeisDockerOrg represents the "deis" docker organization on quay and the docker hub DeisDockerOrg = "deis" )
const (
DockerHubRegistry = "index.docker.io"
)
Variables ¶
This section is empty.
Functions ¶
func PullImages ¶
func PullImages(cl Client, images []*Image) (<-chan Image, <-chan ErrPullImage, <-chan struct{})
PullImages pulls each image in images concurrently. The first returned channel receives on each image successfully pulled, and the second receives on each image that failed to pull for any reason. The total recieves across both channels will equal len(images), and the third channel will be closed only after all of those receives occur.
func PushImages ¶
PushImages pushes docker images, each of which is based on the items in images
func RetagImages ¶
func RetagImages(cl Client, pairs []ImageTagPair) (<-chan ImageTagPair, <-chan ErrTag, <-chan struct{})
RetagImages concurrently retags all of the images in pairs. The first returned chan recieves on each image that successfully is retagged and the second on each image that can't be retagged. The total number of receives on the first and second channels will equal len(pairs), and after all receives happen, the 3rd chan will be closed
Types ¶
type Client ¶
Client is the interface to interact with the docker daemon.
func NewCmdClient ¶
func NewCmdClient() Client
NewCmdClient creates a new Client that does all of its operations by shelling out to the docker CLI
func NewSDKClient ¶
NewSDKClient creates a new Client that uses the SDK under the hood
type ErrInvalidImageName ¶
type ErrInvalidImageName struct {
Str string
}
ErrInvalidImageName is the error returned when a func couldn't parse a string into an Image struct
func (ErrInvalidImageName) Error ¶
func (e ErrInvalidImageName) Error() string
Error is the error interface implementation
type ErrPullImage ¶
ErrPullImage is the error returned when an image couldn't be pulled
func (ErrPullImage) Error ¶
func (e ErrPullImage) Error() string
Error is the error interface implementation
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represents a single image name, including all information about its registry, repository and tag
func ParseImageFromName ¶
ParseImageFromName parses a raw image name string into an Image
func ParseImageFromRepoAndSha ¶
func ParseImageFromRepoAndSha( dockerRegistries []string, dockerRegistryOrg string, ras git.RepoAndSha, ) ([]*Image, error)
ParseImageFromRepoAndSha attempts to convert ras into a set of docker images, each of which points to a registry in registries and uses dockerRegistryOrg. Any registry that matches DockerHubRegistry will be converted to empty
func ParseImagesFromRepoAndShaList ¶
func ParseImagesFromRepoAndShaList( dockerRegistries []string, dockerRegistryOrg string, rasl *git.RepoAndShaList, ) ([]*Image, error)
ParseImagesFromRepoAndShaList returns a slice of parsed Images in the same order as they appear in rasl.Slice(). Returns an empty slice and a non-nil error if any one of the git.RepoAndShas couldn't be parsed
func (Image) FullWithoutTag ¶
FullWithoutTag returns the full image name without its tag
type ImageTagPair ¶
ImageTagPair represents a source image that will be re-tagged to a target image
func CreateImageTagPairsFromTransform ¶
func CreateImageTagPairsFromTransform(images []*Image, transform func(Image) *Image) []ImageTagPair
CreateImageTagPairsFromTransform returns a slice of ImageTagPairs where each source is images[i] and each target is transform(images[i])
type MemoryClient ¶
type MemoryClient struct { Pushes []*Image Pulls []*Image // contains filtered or unexported fields }
MemoryClient is a purely in-memory implementation of Client. It's meant for mocking in unit tests. Create one with NewMemoryClient, not by manually creating a struct instance
func NewMemoryClient ¶
func NewMemoryClient() *MemoryClient
NewMemoryClient creates a new MemoryClient. Always call this function instead of manually creating a MemoryClient struct
func (*MemoryClient) Pull ¶
func (m *MemoryClient) Pull(i *Image) error
Pull is the Client interface implementation
func (*MemoryClient) Push ¶
func (m *MemoryClient) Push(i *Image) error
Push is the Client interface implementation