image: Index | Files | Directories

package docker

import ""


Package Files

cache.go docker_client.go docker_image.go docker_image_dest.go docker_image_src.go docker_transport.go errors.go lookaside.go wwwauthenticate.go


var (
    // ErrV1NotSupported is returned when we're trying to talk to a
    // docker V1 registry.
    ErrV1NotSupported = errors.New("can't talk to a V1 docker registry")
    // ErrTooManyRequests is returned when the status code returned is 429
    ErrTooManyRequests = errors.New("too many requests to registry")
var Transport = dockerTransport{}

Transport is an ImageTransport for Docker registry-hosted images.

func CheckAuth Uses

func CheckAuth(ctx context.Context, sys *types.SystemContext, username, password, registry string) error

CheckAuth validates the credentials by attempting to log into the registry returns an error if an error occurred while making the http request or the status code received was 401

func GetRepositoryTags Uses

func GetRepositoryTags(ctx context.Context, sys *types.SystemContext, ref types.ImageReference) ([]string, error)

GetRepositoryTags list all tags available in the repository. The tag provided inside the ImageReference will be ignored.

func NewReference Uses

func NewReference(ref reference.Named) (types.ImageReference, error)

NewReference returns a Docker reference for a named reference. The reference must satisfy !reference.IsNameOnly().

func ParseReference Uses

func ParseReference(refString string) (types.ImageReference, error)

ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an Docker ImageReference.

type ErrUnauthorizedForCredentials Uses

type ErrUnauthorizedForCredentials struct {
    Err error

ErrUnauthorizedForCredentials is returned when the status code returned is 401

func (ErrUnauthorizedForCredentials) Error Uses

func (e ErrUnauthorizedForCredentials) Error() string

type Image Uses

type Image struct {
    // contains filtered or unexported fields

Image is a Docker-specific implementation of types.ImageCloser with a few extra methods which are specific to Docker.

func (*Image) GetRepositoryTags Uses

func (i *Image) GetRepositoryTags(ctx context.Context) ([]string, error)

GetRepositoryTags list all tags available in the repository. The tag provided inside the ImageReference will be ignored. (This is a backward-compatible shim method which calls the module-level GetRepositoryTags)

func (*Image) SourceRefFullName Uses

func (i *Image) SourceRefFullName() string

SourceRefFullName returns a fully expanded name for the repository this image is in.

type SearchResult Uses

type SearchResult struct {
    Name        string `json:"name"`
    Description string `json:"description"`
    // StarCount states the number of stars the image has
    StarCount int  `json:"star_count"`
    IsTrusted bool `json:"is_trusted"`
    // IsAutomated states whether the image is an automated build
    IsAutomated bool `json:"is_automated"`
    // IsOfficial states whether the image is an official build
    IsOfficial bool `json:"is_official"`

SearchResult holds the information of each matching image It matches the output returned by the v1 endpoint

func SearchRegistry Uses

func SearchRegistry(ctx context.Context, sys *types.SystemContext, registry, image string, limit int) ([]SearchResult, error)

SearchRegistry queries a registry for images that contain "image" in their name The limit is the max number of results desired Note: The limit value doesn't work with all registries for example returns all the results without limiting it to the limit value


referencePackage reference provides a general type to represent any way of referencing images within the registry.
tarfilePackage tarfile is an internal implementation detail of some transports.

Package docker imports 41 packages (graph) and is imported by 45 packages. Updated 2020-05-16. Refresh now. Tools for package owners.