docker_registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 30 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegistryOld

func NewRegistryOld(ctx context.Context, baseURL string, transport http.RoundTripper) (*oldRegistry, error)

NewRegistry creates a registry namespace which can be used to get a listing of repositories

func WithMountFrom

WithMountFrom returns a BlobCreateOption which designates that the blob should be mounted from the given canonical reference.

Types

type Client

type Client interface {
	LabelsForImageName(string) (map[string]string, error)
	GetImageMetadata(imageName, etag string) (Metadata, error)
	AllTags(repoName string) ([]string, error)
	Cancel()
	BecomeFoolishlyTrusting()
}

Client is the interface for interacting with a docker registry

func NewClient

func NewClient(log logging.LogSink) Client

NewClient builds a new client

type ContainerConfig

type ContainerConfig struct {
	Labels  map[string]string
	Env     []string
	OnBuild []string
	Cmd     []string
}

ContainerConfig captures the configuration of a docker container

type DummyRegistryClient

type DummyRegistryClient struct {
	*spies.Spy
}

DummyRegistryClient is a type for use in testing - it supports the Client interface, while only returning metadata that are fed to it

func NewDummyClient

func NewDummyClient() *DummyRegistryClient

NewDummyClient builds and returns a DummyRegistryClient

func (*DummyRegistryClient) AddMetadata added in v1.0.1

func (drc *DummyRegistryClient) AddMetadata(pattern string, md Metadata)

AddMetadata controls the DummyRegistryClient

func (*DummyRegistryClient) AddTag added in v1.0.1

func (drc *DummyRegistryClient) AddTag(pattern string, tag []string)

AddTag controls the DummyRegistryClient

func (*DummyRegistryClient) AllTags

func (drc *DummyRegistryClient) AllTags(rn string) (tags []string, err error)

AllTags fulfills part of Client

func (*DummyRegistryClient) BecomeFoolishlyTrusting

func (drc *DummyRegistryClient) BecomeFoolishlyTrusting()

BecomeFoolishlyTrusting fulfills part of Client

func (*DummyRegistryClient) Cancel

func (drc *DummyRegistryClient) Cancel()

Cancel fulfills part of Client

func (*DummyRegistryClient) FeedMetadata

func (drc *DummyRegistryClient) FeedMetadata(md Metadata)

FeedMetadata is the strings on the marrionette of DummyRegistryClient - having triggered a call to GetImageMetadata or LabelsForImageName, use FeedMetadata to send the Metadata that the notional docker registry might return

func (*DummyRegistryClient) FeedTags

func (drc *DummyRegistryClient) FeedTags(ts []string)

FeedTags is the strings on the marrionette of DummyRegistryClient - having triggered a call to GetImageMetadata or LabelsForImageName, use FeedMetadata to send the Metadata that the notional docker registry might return

func (*DummyRegistryClient) GetImageMetadata

func (drc *DummyRegistryClient) GetImageMetadata(in, et string) (md Metadata, err error)

GetImageMetadata fulfills part of Client

func (*DummyRegistryClient) LabelsForImageName

func (drc *DummyRegistryClient) LabelsForImageName(in string) (labels map[string]string, err error)

LabelsForImageName fulfills part of Client

type Metadata

type Metadata struct {
	Registry      string
	Labels        map[string]string
	Env           map[string]string
	Etag          string
	CanonicalName string
	AllNames      []string
	OnBuild       []string
}

Metadata represents the descriptive data for a docker image

type Registries

type Registries struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Registries is a map+Mutex

func NewRegistries

func NewRegistries() Registries

NewRegistries makes a Registries

func (*Registries) AddRegistry

func (rs *Registries) AddRegistry(n string, r *registry) error

AddRegistry adds a registry to the registry map

func (*Registries) DeleteRegistry

func (rs *Registries) DeleteRegistry(n string) error

DeleteRegistry deletes a registry from the map

func (*Registries) GetRegistry

func (rs *Registries) GetRegistry(n string) *registry

GetRegistry gets a registry from the registry map

type V1Schema

type V1Schema struct {
	//ContainerConfig ContainerConfig `json:"container_config"`
	CC        ContainerConfig `json:"container_config"`
	Container string          `json:"container"`
}

V1Schema Represents the original v1 schema data for a container

Jump to

Keyboard shortcuts

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