registry

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package registry resolves the current manifest digest for an image tag from its registry, using a cheap manifest HEAD and the standard bearer-token auth challenge flow. It never pulls image layers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client resolves remote digests.

func New

func New() *Client

New returns a Client. If a Docker config.json is present (DOCKER_CONFIG or ~/.docker/config.json), its registry credentials are used; otherwise requests are anonymous.

func (*Client) Credentials added in v0.1.4

func (c *Client) Credentials(image string) (user, pass, host string, ok bool)

Credentials returns the stored basic-auth username/password and registry host for an image, so they can be forwarded to the Docker daemon when it pulls (the daemon does not see PullPilot's mounted config.json). ok is false if no credentials are configured for that registry.

func (*Client) RemoteDigest

func (c *Client) RemoteDigest(ctx context.Context, image string) (string, error)

RemoteDigest returns the current manifest (or index) digest for the tag of the given image reference. For a digest-pinned reference it returns the pin.

type CredStore

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

CredStore holds registry credentials parsed from a Docker config.json.

func (*CredStore) Basic

func (s *CredStore) Basic(host string) (string, string, bool)

Basic returns username/password for a registry host, if known.

type Ref

type Ref struct {
	Registry   string // network host, e.g. registry-1.docker.io
	Repository string // e.g. library/nginx
	Tag        string // e.g. latest (empty if pinned by digest)
	Digest     string // sha256:… if the ref is pinned by digest
}

Ref is a parsed image reference.

func ParseRef

func ParseRef(image string) (Ref, error)

ParseRef normalizes an image reference (adding docker.io/library and :latest as needed) and splits it into registry host, repository, tag and/or digest.

func (Ref) Pinned

func (r Ref) Pinned() bool

Pinned reports whether the reference is pinned to an immutable digest.

Jump to

Keyboard shortcuts

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