registrycatalog

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package registrycatalog implements a minimal client for the Docker Registry HTTP API v2's catalog endpoints (_catalog, <name>/tags/list), used to browse repositories and tags in Levelrail's own built-in registry (internal/reconcile/registry) from the app-creation UI. Deliberately scoped to that one registry: see internal/api's RegistryCatalogClient interface doc comment for why an arbitrary external registry's catalog isn't queried the same way.

Index

Constants

View Source
const AllowPrivateEnv = "APP_REGISTRY_ALLOW_PRIVATE_NETWORKS"

AllowPrivateEnv additionally lets operators use registries on loopback. Private LAN ranges are allowed by default; link-local and metadata addresses are always refused.

Variables

View Source
var ErrNotFound = errors.New("registrycatalog: repository not found")

ErrNotFound reports that the registry has no such repository, the v2 API's own signal (a 404 from tags/list) for a name nothing has ever been pushed to, distinct from an unreachable registry or a rejected credential.

Functions

func AllowPrivate

func AllowPrivate() bool

AllowPrivate reports whether AllowPrivateEnv is set to a true value.

Types

type Client

type Client struct {
	HTTP *http.Client
}

Client queries a Docker Registry HTTP API v2 server's catalog endpoints over Basic Auth.

func NewClient

func NewClient() *Client

NewClient returns a Client with a bounded per-request timeout: every call here is a single small JSON request, not a long-lived stream, the same shape githubapp.NewClient establishes for its own client.

func NewExternalClient

func NewExternalClient() *Client

NewExternalClient is NewClient for operator-supplied registry addresses: dials are guarded against internal targets and redirects are not followed, so the Basic credential never leaves the chosen host.

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, baseURL, username, password string) ([]string, error)

ListRepositories queries GET {baseURL}/v2/_catalog, returning every repository name the registry knows about, sorted for a stable UI order (the wire response's own ordering is unspecified).

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context, baseURL, username, password, repository string) ([]string, error)

ListTags queries GET {baseURL}/v2/{repository}/tags/list. repository may itself contain slashes (a namespaced name like "org/app"): it is path-escaped per segment, not as a whole, so those slashes still separate real path segments on the wire.

func (*Client) ListTagsAnonymous

func (c *Client) ListTagsAnonymous(ctx context.Context, baseURL, repository string) ([]string, error)

ListTagsAnonymous lists every tag of a public repository, following the anonymous bearer token flow and Link pagination of the OCI distribution API.

type RateLimitError

type RateLimitError struct {
	RetryAfter time.Duration
}

RateLimitError reports an upstream 429 together with its Retry-After.

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

Jump to

Keyboard shortcuts

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