testregistry

package
v0.111.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const RootLayer = `` /* 308-byte string literal not displayed */

A base64 encoded gzipped tarball with the following contents:

-rw-r--r-- root/root        12 2021-09-17 12:32 hello.txt         (Contents: "Hello World")
drwxr-xr-x root/root         0 1970-01-01 01:00 subdir/
-rw-r--r-- root/root         8 2021-09-17 12:32 subdir/file.txt   (Contents: "osbuild")
-rw-r--r-- root/root         7 2021-09-17 12:32 world.txt         (Contents: "hello!")

Can be used with NewDataBlobFromBase64 to create a data blob for Repo.AddImage.

Variables

This section is empty.

Functions

func BlobIsManifest

func BlobIsManifest(blob Blob) bool

func MakeDescriptorForBlob

func MakeDescriptorForBlob(b Blob) manifest.Schema2Descriptor

func NewDataBlobFromBase64

func NewDataBlobFromBase64(text string) dataBlob

func WriteBlob

func WriteBlob(blob Blob, w http.ResponseWriter)

Types

type Blob

type Blob interface {
	GetSize() int64
	GetMediaType() string
	GetDigest() digest.Digest

	Reader() io.Reader
}

Blob interface

type Registry

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

func New

func New() *Registry

func (*Registry) AddRepo

func (reg *Registry) AddRepo(name string) *Repo

func (*Registry) Close

func (reg *Registry) Close()

func (*Registry) GetRef

func (reg *Registry) GetRef(repo string) string

func (*Registry) Resolve

func (reg *Registry) Resolve(target string, imgArch arch.Arch) (container.Spec, error)

func (*Registry) ServeHTTP

func (reg *Registry) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Repo

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

Repo //

func NewRepo

func NewRepo() *Repo

func (*Repo) AddBlob

func (r *Repo) AddBlob(b Blob) manifest.Schema2Descriptor

func (*Repo) AddImage

func (r *Repo) AddImage(layers []Blob, arches []string, comment string, ctime time.Time) string

func (*Repo) AddManifest

func (r *Repo) AddManifest(mf *manifest.Schema2) manifest.Schema2Descriptor

func (*Repo) AddObject

func (r *Repo) AddObject(v interface{}, mediaType string) manifest.Schema2Descriptor

func (*Repo) AddTag

func (r *Repo) AddTag(checksum, tag string)

func (*Repo) ServeBlob

func (r *Repo) ServeBlob(ref string, w http.ResponseWriter, req *http.Request)

func (*Repo) ServeManifest

func (r *Repo) ServeManifest(ref string, w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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