gar

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 10 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 gar lists Google Artifact Registry Docker repositories through the Artifact Registry API instead of the distribution API. One dockerImages page covers up to 1,000 manifests of a repository with their tags and upload times, so tags need no request each.

Index

Constants

View Source
const ArtifactRegistryAPI = "https://artifactregistry.googleapis.com/v1"

ArtifactRegistryAPI is the default API endpoint.

Variables

This section is empty.

Functions

func ParseHost

func ParseHost(host string) (location string, ok bool)

ParseHost returns the location of an Artifact Registry host.

Types

type Options

type Options struct {
	// Projects are the Google Cloud projects whose repositories are
	// listed. Repos can also be seeded as project/repository/image.
	Projects []string
	// Token returns an OAuth access token for the APIs.
	Token func() (string, error)
	// RegistryAPI overrides the endpoint, for tests.
	RegistryAPI string
	Transport   http.RoundTripper
	UserAgent   string
}

Options configure a client.

type Registry

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

Registry is one Artifact Registry location. It is a crawl.Lister.

func New

func New(host string, opts Options) (*Registry, error)

New returns a client for an Artifact Registry host.

func (*Registry) Calls

func (r *Registry) Calls() int64

Calls returns how many API calls the client has made.

func (*Registry) Images

func (r *Registry) Images(ctx context.Context, path string) ([]crawl.Listed, error)

Images lists every manifest of an image path, project/repository/image, with its tags and upload time.

func (*Registry) Repos

func (r *Registry) Repos(ctx context.Context) ([]string, error)

Repos lists the image paths, as project/repository/image, of every Docker repository in the configured projects at this location. Listing a repository lists all its images, which Images then hands out.

Jump to

Keyboard shortcuts

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