manifest

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaTypeManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
	MediaTypeManifest     = "application/vnd.docker.distribution.manifest.v2+json"
)
View Source
const (
	ProxyRefAnnotationPrefix = "com.container-registry.proxy-ref-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	SetWithTTL(key, value interface{}, cost int64, ttl time.Duration) bool
	Get(key interface{}) (interface{}, bool)
}

type Catalog

type Catalog struct {
	Repos []string `json:"repositories"`
}

type Config

type Config struct {
	Debug              bool
	CacheTTL           time.Duration // for how long store manifest
	IndexCacheTTL      time.Duration
	IndexErrorCacheTTl time.Duration
}

type InternalDst

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

func NewInternalDst

func NewInternalDst(repo string, blobPutHandler handler.BlobPutHandler, manifests *Manifests) *InternalDst

func (*InternalDst) Exists

func (f *InternalDst) Exists(ctx context.Context, target ocispec.Descriptor) (bool, error)

func (*InternalDst) Fetch

func (f *InternalDst) Fetch(ctx context.Context, target ocispec.Descriptor) (io.ReadCloser, error)

func (*InternalDst) Push

func (f *InternalDst) Push(ctx context.Context, expected ocispec.Descriptor, content io.Reader) error

Push no need lock

func (*InternalDst) Resolve

func (f *InternalDst) Resolve(ctx context.Context, reference string) (ocispec.Descriptor, error)

func (*InternalDst) Tag

func (f *InternalDst) Tag(ctx context.Context, desc ocispec.Descriptor, reference string) error

type Manifest

type Manifest struct {
	ContentType string    `json:"contentType"`
	Blob        []byte    `json:"blob"`
	Refs        []string  `json:"refs"` // referenced blobs digests
	CreatedAt   time.Time `json:"createdAt"`
}

type Manifests

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

func NewManifests

func NewManifests(ctx context.Context, blobHandler handler.BlobHandler, config Config, cache Cache, log logrus.StdLogger) *Manifests

func (*Manifests) GetIndex

func (m *Manifests) GetIndex(repoURLPath string) (*repo.IndexFile, error)

func (*Manifests) HandleCatalog

func (m *Manifests) HandleCatalog(resp http.ResponseWriter, req *http.Request) error

func (*Manifests) HandleTags

func (m *Manifests) HandleTags(resp http.ResponseWriter, req *http.Request) error

func (*Manifests) Read

func (m *Manifests) Read(repo string, name string) (Manifest, error)

func (*Manifests) Write

func (m *Manifests) Write(repo string, name string, n Manifest) error

Jump to

Keyboard shortcuts

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