proxy

package
v0.0.0-...-71b587c Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Docker is the client connected to the docker daemon
	Docker *docker.Client
	// Prefixes is a set of image ref prefixes that are proxied by this registry
	Prefixes map[string]struct{}
}

type Registry

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

func New

func New(cfg Config) *Registry

func (*Registry) BuildHandler

func (r *Registry) BuildHandler() http.Handler

func (*Registry) BuildIndex

func (r *Registry) BuildIndex(ctx context.Context) error

BuildIndex builds the blob to manifest index. Docker only allows listing and retreiving images, not layers/blobs, so the proxy must maintain its own index mapping blobs to manifests. On startup, this index is empty, but calling BuildIndex will list all images with the provided prefixes (or all images if no prefixes are provided), and build this index. This is slow, however, any successful /v2/{name}/manifests/{reference} will also index that particular image, so this call should only be needed if the API is used directly to fetch blobs without first obtaining a manifest.

func (*Registry) HasAllowedPrefix

func (r *Registry) HasAllowedPrefix(name string) bool

Jump to

Keyboard shortcuts

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