package common

import "github.com/appc/docker2aci/lib/common"

Package common provides misc types and variables.

Index

Constants

const (
	NoCompression = iota
	GzipCompression
)
const (
	// AppcDockerOriginalName is the unmodified name this image was originally
	// referenced by for fetching, e.g. something like "nginx:tag" or
	// "quay.io/user/image:latest" This is identical in most cases to
	// 'registryurl/repository:tag' but may differ for the default Dockerhub
	// registry or if the tag was inferred as latest.
	AppcDockerOriginalName  = "appc.io/docker/originalname"
	AppcDockerRegistryURL   = "appc.io/docker/registryurl"
	AppcDockerRepository    = "appc.io/docker/repository"
	AppcDockerTag           = "appc.io/docker/tag"
	AppcDockerImageID       = "appc.io/docker/imageid"
	AppcDockerParentImageID = "appc.io/docker/parentimageid"
	AppcDockerEntrypoint    = "appc.io/docker/entrypoint"
	AppcDockerCmd           = "appc.io/docker/cmd"
	AppcDockerManifestHash  = "appc.io/docker/manifesthash"
)
const (
	MediaTypeDockerV21Manifest       = "application/vnd.docker.distribution.manifest.v1+json"
	MediaTypeDockerV21SignedManifest = "application/vnd.docker.distribution.manifest.v1+prettyjws"
	MediaTypeDockerV21ManifestLayer  = "application/vnd.docker.container.image.rootfs.diff+x-gtar"

	MediaTypeDockerV22Manifest     = "application/vnd.docker.distribution.manifest.v2+json"
	MediaTypeDockerV22ManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
	MediaTypeDockerV22Config       = "application/vnd.docker.container.image.v1+json"
	MediaTypeDockerV22RootFS       = "application/vnd.docker.image.rootfs.diff.tar.gzip"

	MediaTypeOCIV1Manifest     = spec.MediaTypeImageManifest
	MediaTypeOCIV1ManifestList = spec.MediaTypeImageManifestList
	MediaTypeOCIV1Config       = spec.MediaTypeImageConfig
	MediaTypeOCIV1Layer        = spec.MediaTypeImageLayer
)
const (
	MediaTypeOptionDockerV21 = iota
	MediaTypeOptionDockerV22
	MediaTypeOptionOCIV1Pre
)
const (
	RegistryOptionV1 = iota
	RegistryOptionV2
)

Functions

func ValidateLayerId

func ValidateLayerId(id string) error

ValidateLayerId validates a layer ID

Types

type Compression

type Compression int

type ErrSeveralImages

type ErrSeveralImages struct {
	Msg    string
	Images []string
}

func (*ErrSeveralImages) Error

func (e *ErrSeveralImages) Error() string

type InsecureConfig

type InsecureConfig struct {
	SkipVerify bool
	AllowHTTP  bool
}

InsecureConfig represents the different insecure options available

type MediaTypeOption

type MediaTypeOption int

MediaTypeOption represents the media types for a given docker image (or oci) spec.

type MediaTypeSet

type MediaTypeSet []MediaTypeOption

MediaTypeSet represents a set of media types which docker2aci is to use when fetchimg images. As an example if a MediaTypeSet is equal to {MediaTypeOptionDockerV22, MediaTypeOptionOCIV1Pre}, then when an image pull is made V2.1 images will not be fetched. This doesn't apply to V1 pulls. As an edge case if a MedaTypeSet is nil or empty, that means that _every_ type of media type is enabled. This type is intended to be a set, and putting duplicates in this set is generally unadvised.

func (MediaTypeSet) ConfigMediaTypes

func (m MediaTypeSet) ConfigMediaTypes() []string

func (MediaTypeSet) LayerMediaTypes

func (m MediaTypeSet) LayerMediaTypes() []string

func (MediaTypeSet) ManifestMediaTypes

func (m MediaTypeSet) ManifestMediaTypes() []string

type ParsedDockerURL

type ParsedDockerURL struct {
	OriginalName string
	IndexURL     string
	ImageName    string
	Tag          string
	Digest       string
}

ParsedDockerURL represents a parsed Docker URL.

func ParseDockerURL

func ParseDockerURL(arg string) (*ParsedDockerURL, error)

ParseDockerURL takes a Docker URL and returns a ParsedDockerURL with its index URL, image name, and tag.

type RegistryOption

type RegistryOption int

RegistryOption represents a type of a registry, based on the version of the docker http API.

type RegistryOptionSet

type RegistryOptionSet []RegistryOption

RegistryOptionSet represents a set of registry types which docker2aci is to use when fetching images. As an example if a RegistryOptionSet is equal to {RegistryOptionV2}, then v1 pulls are disabled. As an edge case if a RegistryOptionSet is nil or empty, that means that _every_ type of registry is enabled. This type is intended to be a set, and putting duplicates in this set is generally unadvised.

func (RegistryOptionSet) AllowsV1

func (r RegistryOptionSet) AllowsV1() bool

func (RegistryOptionSet) AllowsV2

func (r RegistryOptionSet) AllowsV2() bool

Source Files

common.go

Version
v0.17.2 (latest)
Published
Apr 13, 2018
Platform
linux/amd64
Imports
5 packages
Last checked
8 hours ago

Tools for package owners.