ocimem

package
v0.0.0-...-a929655 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDescriptor

func CheckDescriptor(desc ociregistry.Descriptor, data []byte) error

CheckDescriptor checks that the given descriptor matches the given data or, if data is nil, that the descriptor looks sane.

func NewBytesReader

func NewBytesReader(data []byte, desc ociregistry.Descriptor) ociregistry.BlobReader

NewBytesReader returns an implementation of ociregistry.BlobReader that returns the given bytes. It fills in desc.Digest and desc.Size.

Types

type Buffer

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

Buffer holds an in-memory implementation of ociregistry.BlobWriter.

func NewBuffer

func NewBuffer(commit func(b *Buffer) error, uuid string) *Buffer

NewBuffer returns a buffer that calls commit with the when Buffer.Commit is invoked successfully. / It's OK to call methods concurrently on a buffer.

func (*Buffer) Cancel

func (b *Buffer) Cancel() error

func (*Buffer) Close

func (b *Buffer) Close() error

func (*Buffer) Commit

func (b *Buffer) Commit(dig ociregistry.Digest) (_ ociregistry.Descriptor, err error)

Commit implements ociregistry.BlobWriter.Commit by checking that everything looks OK and calling the commit function if so.

func (*Buffer) GetBlob

func (b *Buffer) GetBlob() (ociregistry.Descriptor, []byte, error)

GetBlob returns any committed data and is descriptor. It returns an error if the data hasn't been committed or there was an error doing so.

func (*Buffer) ID

func (b *Buffer) ID() string

ID implements ociregistry.BlobWriter.ID by returning a randomly allocated hex UUID.

func (*Buffer) Size

func (b *Buffer) Size() int64

func (*Buffer) Write

func (b *Buffer) Write(data []byte) (int, error)

Write implements io.Writer by writing some data to the blob.

type Registry

type Registry struct {
	*ociregistry.Funcs
	// contains filtered or unexported fields
}

func New

func New() *Registry

func (*Registry) DeleteBlob

func (r *Registry) DeleteBlob(ctx context.Context, repoName string, digest ociregistry.Digest) error

func (*Registry) DeleteManifest

func (r *Registry) DeleteManifest(ctx context.Context, repoName string, digest ociregistry.Digest) error

func (*Registry) DeleteTag

func (r *Registry) DeleteTag(ctx context.Context, repoName string, tagName string) error

func (*Registry) GetBlob

func (r *Registry) GetBlob(ctx context.Context, repoName string, dig ociregistry.Digest) (ociregistry.BlobReader, error)

func (*Registry) GetManifest

func (r *Registry) GetManifest(ctx context.Context, repoName string, dig ociregistry.Digest) (ociregistry.BlobReader, error)

func (*Registry) GetTag

func (r *Registry) GetTag(ctx context.Context, repoName string, tagName string) (ociregistry.BlobReader, error)

func (*Registry) MountBlob

func (r *Registry) MountBlob(ctx context.Context, fromRepo, toRepo string, dig ociregistry.Digest) (ociregistry.Descriptor, error)

func (*Registry) PushBlob

func (r *Registry) PushBlob(ctx context.Context, repoName string, desc ociregistry.Descriptor, content io.Reader) (ociregistry.Descriptor, error)

func (*Registry) PushBlobChunked

func (r *Registry) PushBlobChunked(ctx context.Context, repoName string, resumeID string, chunkSize int) (ociregistry.BlobWriter, error)

func (*Registry) PushManifest

func (r *Registry) PushManifest(ctx context.Context, repoName string, tag string, data []byte, mediaType string) (ociregistry.Descriptor, error)

func (*Registry) Referrers

func (r *Registry) Referrers(ctx context.Context, repoName string, digest ociregistry.Digest, artifactType string) ociregistry.Iter[ociregistry.Descriptor]

func (*Registry) Repositories

func (r *Registry) Repositories(ctx context.Context) ociregistry.Iter[string]

func (*Registry) ResolveBlob

func (r *Registry) ResolveBlob(ctx context.Context, repoName string, digest ociregistry.Digest) (ociregistry.Descriptor, error)

func (*Registry) ResolveManifest

func (r *Registry) ResolveManifest(ctx context.Context, repoName string, digest ociregistry.Digest) (ociregistry.Descriptor, error)

func (*Registry) ResolveTag

func (r *Registry) ResolveTag(ctx context.Context, repoName string, tagName string) (ociregistry.Descriptor, error)

func (*Registry) Tags

func (r *Registry) Tags(ctx context.Context, repoName string) ociregistry.Iter[string]

Jump to

Keyboard shortcuts

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