registry

package
v17.12.0-ce+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hosting

func Hosting() bool

Hosting returns wether the host can host a registry (v2) or not

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock represent a registry mock

func NewMock

func NewMock(t testingT) (*Mock, error)

NewMock creates a registry mock

func (*Mock) Close

func (tr *Mock) Close()

Close closes mock and releases resources

func (*Mock) RegisterHandler

func (tr *Mock) RegisterHandler(path string, h handlerFunc)

RegisterHandler register the specified handler for the registry mock

func (*Mock) URL

func (tr *Mock) URL() string

URL returns the url of the registry

type V2

type V2 struct {
	// contains filtered or unexported fields
}

V2 represent a registry version 2

func NewV2

func NewV2(schema1 bool, auth, tokenURL, registryURL string) (*V2, error)

NewV2 creates a v2 registry server

func (*V2) Close

func (r *V2) Close()

Close kills the registry server

func (*V2) Email

func (r *V2) Email() string

Email returns the configured email of the server

func (*V2) Password

func (r *V2) Password() string

Password returns the configured password of the server

func (*V2) Path

func (r *V2) Path() string

Path returns the path where the registry write data

func (*V2) Ping

func (r *V2) Ping() error

Ping sends an http request to the current registry, and fail if it doesn't respond correctly

func (*V2) ReadBlobContents

func (r *V2) ReadBlobContents(t testingT, blobDigest digest.Digest) []byte

ReadBlobContents read the file corresponding to the specified digest

func (*V2) TempMoveBlobData

func (r *V2) TempMoveBlobData(t testingT, blobDigest digest.Digest) (undo func())

TempMoveBlobData moves the existing data file aside, so that we can replace it with a malicious blob of data for example.

func (*V2) Username

func (r *V2) Username() string

Username returns the configured user name of the server

func (*V2) WriteBlobContents

func (r *V2) WriteBlobContents(t testingT, blobDigest digest.Digest, data []byte)

WriteBlobContents write the file corresponding to the specified digest with the given content

Jump to

Keyboard shortcuts

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