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(data []byte, desc ociregistry.Descriptor) ociregistry.BlobReader
NewBytesReader returns an implementation of ociregistry.BlobReader that returns the given bytes. The returned reader will return desc from its Descriptor method.
Buffer holds an in-memory implementation of ociregistry.BlobWriter.
type Buffer struct {
// contains filtered or unexported fields
}
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 (b *Buffer) Cancel() error
func (b *Buffer) ChunkSize() int
func (b *Buffer) Close() error
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 (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 (b *Buffer) ID() string
ID implements ociregistry.BlobWriter.ID by returning a randomly allocated hex UUID.
func (b *Buffer) Size() int64
func (b *Buffer) Write(data []byte) (int, error)
Write implements io.Writer by writing some data to the blob.
Config holds configuration for the registry.
type Config struct { // ImmutableTags specifies that tags in the registry cannot // be changed. Specifically the following restrictions are enforced: // - no removal of tags from a manifest // - no pushing of a tag if that tag already exists with a different // digest or media type. // - no deletion of directly tagged manifests // - no deletion of any blob or manifest that a tagged manifest // refers to (TODO: not implemented yet) ImmutableTags bool }
type Registry struct { *ociregistry.Funcs // contains filtered or unexported fields }
func New() *Registry
New is like NewWithConfig(nil).
func NewWithConfig(cfg0 *Config) *Registry
NewWithConfig returns a new in-memory ociregistry.Interface implementation using the given configuration. If cfg is nil, it's treated the same as a pointer to the zero Config value.
func (r *Registry) DeleteBlob(ctx context.Context, repoName string, digest ociregistry.Digest) error
func (r *Registry) DeleteManifest(ctx context.Context, repoName string, digest ociregistry.Digest) error
func (r *Registry) DeleteTag(ctx context.Context, repoName string, tagName string) error
func (r *Registry) GetBlob(ctx context.Context, repoName string, dig ociregistry.Digest) (ociregistry.BlobReader, error)
func (r *Registry) GetBlobRange(ctx context.Context, repoName string, dig ociregistry.Digest, o0, o1 int64) (ociregistry.BlobReader, error)
func (r *Registry) GetManifest(ctx context.Context, repoName string, dig ociregistry.Digest) (ociregistry.BlobReader, error)
func (r *Registry) GetTag(ctx context.Context, repoName string, tagName string) (ociregistry.BlobReader, error)
func (r *Registry) MountBlob(ctx context.Context, fromRepo, toRepo string, dig ociregistry.Digest) (ociregistry.Descriptor, error)
func (r *Registry) PushBlob(ctx context.Context, repoName string, desc ociregistry.Descriptor, content io.Reader) (ociregistry.Descriptor, error)
func (r *Registry) PushBlobChunked(ctx context.Context, repoName string, chunkSize int) (ociregistry.BlobWriter, error)
func (r *Registry) PushBlobChunkedResume(ctx context.Context, repoName, id string, offset int64, chunkSize int) (ociregistry.BlobWriter, error)
func (r *Registry) PushManifest(ctx context.Context, repoName string, tag string, data []byte, mediaType string) (ociregistry.Descriptor, error)
func (r *Registry) Referrers(ctx context.Context, repoName string, digest ociregistry.Digest, artifactType string) ociregistry.Seq[ociregistry.Descriptor]
func (r *Registry) Repositories(ctx context.Context, startAfter string) ociregistry.Seq[string]
func (r *Registry) ResolveBlob(ctx context.Context, repoName string, digest ociregistry.Digest) (ociregistry.Descriptor, error)
func (r *Registry) ResolveManifest(ctx context.Context, repoName string, digest ociregistry.Digest) (ociregistry.Descriptor, error)
func (r *Registry) ResolveTag(ctx context.Context, repoName string, tagName string) (ociregistry.Descriptor, error)
func (r *Registry) Tags(ctx context.Context, repoName string, startAfter string) ociregistry.Seq[string]