registryclient

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package registryclient is a small HTTP client for OCI Distribution registries.

Index

Constants

This section is empty.

Variables

View Source
var ErrManifestNotFound = errors.New("registryclient: manifest not found")

ErrManifestNotFound distinguishes 404 from transport errors.

Functions

This section is empty.

Types

type Client

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

Client is an HTTP client for OCI Distribution registries.

func New

func New(baseURL, token string) *Client

New creates a client. Empty baseURL defaults to http://127.0.0.1:8080.

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL returns the registry base URL.

func (*Client) BlobExists

func (c *Client) BlobExists(ctx context.Context, name, digest string) (bool, error)

BlobExists checks whether a blob with the given digest exists.

func (*Client) Catalog added in v0.1.7

func (c *Client) Catalog(ctx context.Context) ([]string, error)

Catalog returns all repository names from /v2/_catalog.

func (*Client) DeleteManifest added in v0.1.7

func (c *Client) DeleteManifest(ctx context.Context, name, reference string) error

DeleteManifest removes a manifest. A 404 (already absent) is treated as success.

func (*Client) GetBlob

func (c *Client) GetBlob(ctx context.Context, name, digest string) (io.ReadCloser, error)

GetBlob downloads a blob. Caller must close the body.

func (*Client) GetManifest

func (c *Client) GetManifest(ctx context.Context, name, tag string) ([]byte, string, error)

GetManifest downloads a manifest. Returns ErrManifestNotFound on 404.

func (*Client) ListTags added in v0.1.7

func (c *Client) ListTags(ctx context.Context, name string) ([]string, error)

ListTags returns all tags for a repository.

func (*Client) PutBlob

func (c *Client) PutBlob(ctx context.Context, name, digest string, body io.Reader, size int64) error

PutBlob uploads a blob with the given digest.

func (*Client) PutManifest added in v0.1.7

func (c *Client) PutManifest(ctx context.Context, name, tag string, data []byte, contentType string) error

PutManifest uploads a manifest under the given tag.

Jump to

Keyboard shortcuts

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