container

package
v0.0.0-...-c20e4a3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestV1ContentType         = "application/vnd.docker.distribution.manifest.v1+json"
	ManifestV2ContentType         = "application/vnd.docker.distribution.manifest.v2+json"
	ManifestListV2ContentType     = "application/vnd.docker.distribution.manifest.list.v2+json"
	ManifestOCIV1ContentType      = "application/vnd.oci.image.manifest.v1+json"
	ManifestOCIIndexV1ContentType = "application/vnd.oci.image.index.v1+json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ManifestListV2

type ManifestListV2 struct {
	SchemaVersion int    `json:"schemaVersion"`
	MediaType     string `json:"mediaType"` // application/vnd.docker.distribution.manifest.list.v2+json
	ArtifactType  string `json:"artifactType,omitempty"`
	Manifests     []struct {
		MediaType string `json:"mediaType"` // application/vnd.docker.distribution.manifest.v2+json
		Size      int    `json:"size"`
		Digest    string `json:"digest"`
		Platform  struct {
			Architecture string   `json:"architecture,omitempty"`
			Os           string   `json:"os,omitempty"`
			OsVersion    string   `json:"os.version,omitempty"`
			OsFeatures   []string `json:"os.features,omitempty"`
			Variant      string   `json:"variant,omitempty"`
			Features     []string `json:"features,omitempty"`
		} `json:"platform,omitempty"`
	} `json:"manifests,omitempty"`
	Subject struct {
		MediaType    string            `json:"mediaType,omitempty"`
		Size         int               `json:"size,omitempty"`
		Digest       string            `json:"digest,omitempty"`
		Urls         []string          `json:"urls,omitempty"`
		Annotations  map[string]string `json:"annotations,omitempty"`
		Data         string            `json:"data,omitempty"`
		ArtifactType string            `json:"artifactType,omitempty"`
	} `json:"subject,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ManifestV1

type ManifestV1 struct {
	Name     string `json:"name,omitempty"`
	Tag      string `json:"tag,omitempty"`
	FsLayers []struct {
		BlobSum string `json:"blobSum,omitempty"`
	} `json:"fsLayers,omitempty"`
	History []struct {
		V1Compatibility string `json:"v1Compatibility,omitempty"`
	} `json:"history,omitempty"`
	SchemaVersion int `json:"schemaVersion,omitempty"`
	Signatures    []struct {
		Header struct {
			Jwk struct {
				Crv string `json:"crv,omitempty"`
				Kid string `json:"kid,omitempty"`
				Kty string `json:"kty,omitempty"`
				X   string `json:"x,omitempty"`
				Y   string `json:"y,omitempty"`
			} `json:"jwk"`
			Alg string `json:"alg,omitempty"`
		} `json:"header,omitempty"`
		Signature string `json:"signature,omitempty"`
		Protected string `json:"protected,omitempty"`
	} `json:"signatures,omitempty"`
}

type ManifestV2

type ManifestV2 struct {
	SchemaVersion int    `json:"schemaVersion,omitempty"`
	MediaType     string `json:"mediaType,omitempty"`
	Config        struct {
		MediaType string `json:"mediaType,omitempty"`
		Size      int    `json:"size,omitempty"`
		Digest    string `json:"digest,omitempty"`
	} `json:"config"`
	Layers []struct {
		MediaType   string            `json:"mediaType,omitempty"`
		Size        int               `json:"size,omitempty"`
		Digest      string            `json:"digest,omitempty"`
		Annotations map[string]string `json:"annotations,omitempty"`
	} `json:"layers"`
}

type PackageMetadata

type PackageMetadata struct {
	ContentType    string `json:"contentType"`
	Digest         string `json:"digest"`
	MetadataBuffer []byte `json:"metadataBuffer"`
}

type Service

type Service struct {
	services.BasePackageService
}

func NewService

func NewService(storage storage.BaseStorageBackend) *Service

func (*Service) CheckBlobExistenceHandler

func (s *Service) CheckBlobExistenceHandler(c *gin.Context)

func (*Service) CheckMetadataHandler

func (s *Service) CheckMetadataHandler(c *gin.Context)

func (*Service) ChunkUploadHandler

func (s *Service) ChunkUploadHandler(c *gin.Context)

func (*Service) DownloadHandler

func (s *Service) DownloadHandler(c *gin.Context)

func (*Service) GetAssetsByManifest

func (s *Service) GetAssetsByManifest(metadata *PackageMetadata) (assets []models.Asset, err error)

func (*Service) GetUploadProgressHandler

func (s *Service) GetUploadProgressHandler(c *gin.Context)

func (*Service) ManifestUploadHandler

func (s *Service) ManifestUploadHandler(c *gin.Context)

func (*Service) MetadataHandler

func (s *Service) MetadataHandler(c *gin.Context)

func (*Service) PkgInfoFromRequest

func (s *Service) PkgInfoFromRequest(c *gin.Context) (pkgName string, filename string)

func (*Service) SetAuthHeaderAndAbort

func (s *Service) SetAuthHeaderAndAbort(c *gin.Context)

func (*Service) StartLayerUploadHandler

func (s *Service) StartLayerUploadHandler(c *gin.Context)

StartLayerUploadHandler POST /v2/<name>/blobs/uploads/

func (*Service) UploadHandler

func (s *Service) UploadHandler(c *gin.Context)

Jump to

Keyboard shortcuts

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