registry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderDockerContentDigest          = "Docker-Content-Digest"
	HeaderDockerDistributionApiVersion = "Docker-Distribution-API-Version"
)

OCI - Distribution Spec compliant Headers

View Source
const (
	RegistryErrorCodeUnknown             = "UNKNOWN"               // error unknown to registry
	RegistryErrorCodeBlobUnknown         = "BLOB_UNKNOWN"          //blob unknown to registry
	RegistryErrorCodeBlobUploadInvalid   = "BLOB_UPLOAD_INVALID"   //blob upload invalid
	RegistryErrorCodeBlobUploadUnknown   = "BLOB_UPLOAD_UNKNOWN"   // blob upload unknown to registry
	RegistryErrorCodeDigestInvalid       = "DIGEST_INVALID"        // provided digest did not match uploaded content
	RegistryErrorCodeManifestBlobUnknown = "MANIFEST_BLOB_UNKNOWN" // blob unknown to registry
	RegistryErrorCodeManifestInvalid     = "MANIFEST_INVALID"      // manifest invalid
	RegistryErrorCodeManifestUnknown     = "MANIFEST_UNKNOWN"      // manifest unknown
	RegistryErrorCodeManifestUnverified  = "MANIFEST_UNVERIFIED"   // manifest failed sign verification
	RegistryErrorCodeNameInvalid         = "NAME_INVALID"          // invalid repository name
	RegistryErrorCodeNameUnknown         = "NAME_UNKNOWN"          // repository name not known to registry
	RegistryErrorCodeSizeInvalid         = "SIZE_INVALID"          //provided length did not match content length
	RegistryErrorCodeTagInvalid          = "TAG_INVALID"           // manifest tag did not match URI
	RegistryErrorCodeUnauthorized        = "UNAUTHORIZED"          // authentication is required
	RegistryErrorCodeDenied              = "DENIED"                // request access to resource is denied
	RegistryErrorCodeUnsupported         = "UNSUPPORTED"           // operation is not supported
)

// OCI - Distribution Spec compliant Error Codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MediaType string `json:"mediaType"`
	Digest    string `json:"digest"`
	Size      int    `json:"size"`
}

type ImageManifest

type ImageManifest struct {
	Config        Config `json:"config"`
	MediaType     string `json:"mediaType"`
	Layers        Layers `json:"layers"`
	SchemaVersion int    `json:"schemaVersion"`
}

type Layers

type Layers []struct {
	MediaType string `json:"mediaType"`
	Digest    string `json:"digest"`
	Size      int    `json:"size"`
}

type ManifestList

type ManifestList struct {
	MediaType string `json:"mediaType"`
	Manifests []struct {
		MediaType string `json:"mediaType"`
		Digest    string `json:"digest"`
		Platform  struct {
			Architecture string   `json:"architecture"`
			Os           string   `json:"os"`
			Features     []string `json:"features"`
		} `json:"platform"`
		Size int `json:"size"`
	} `json:"manifests"`
	SchemaVersion int `json:"schemaVersion"`
}

type Registry

type Registry interface {
	UploadProgress(ctx echo.Context) error

	// GET /v2/<name>/blobs/<digest>
	PullLayer(ctx echo.Context) error

	// GET /v2/
	ApiVersion(ctx echo.Context) error

	// HEAD /v2/<name>/manifests/<ref>
	ManifestExists(ctx echo.Context) error

	// HEAD /v2/<name>/blobs/<digest>
	LayerExists(ctx echo.Context) error

	PullManifest(ctx echo.Context) error

	PushManifest(ctx echo.Context) error

	PushImage(ctx echo.Context) error

	StartUpload(ctx echo.Context) error

	PushLayer(ctx echo.Context) error

	// PUT /v2/<name>/blobs/uploads/<uuid>?digest=<digest>
	// Content-Length: <size of layer>
	// Content-Type: application/octet-stream
	// <Layer Binary Data>
	MonolithicUpload(ctx echo.Context) error

	/*
			202 Accepted
		    Location: /v2/<name>/blobs/uploads/<uuid>
		    Range: bytes=0-<offset>
		    Content-Length: 0
		    Docker-Upload-UUID: <uuid>
	*/
	ChunkedUpload(ctx echo.Context) error

	CompleteUpload(ctx echo.Context) error

	// DELETE /v2/<name>/blobs/uploads/<uuid>
	CancelUpload(ctx echo.Context) error

	/*
			Success Response

		201 Created
		Location: /v2/<name>/blobs/<digest>
		Content-Length: 0
		Docker-Content-Digest: <digest>
	*/
	BlobMount(ctx echo.Context) error

	// DELETE /v2/<name>/blobs/<digest>
	// 202 Accepted
	// Content-Length: None
	// 404 Not Found for not found layer
	DeleteLayer(ctx echo.Context) error

	// GET /v2/_catalog
	List(ctx echo.Context) error

	// GET /v2/<name>/tags/list
	ListTags(ctx echo.Context) error

	// Success : 202
	DeleteTagOrManifest(ctx echo.Context) error
	//The list of available repositories is made available through the catalog
	Catalog(ctx echo.Context) error
	GetImageNamespace(ctx echo.Context) error
}

func NewRegistry

func NewRegistry(
	skynetClient *skynet.Client,
	logger telemetry.Logger,
	pgStore postgres.PersistentStore,
) (Registry, error)

type RegistryError

type RegistryError struct {
	Detail  map[string]interface{} `json:"detail,omitempty"`
	Code    string                 `json:"code"`
	Message string                 `json:"message"`
}

type RegistryErrors

type RegistryErrors struct {
	Errors []RegistryError `json:"errors"`
}

type TxnStore

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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