registry

package
v0.20.11 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

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 provides methods to interact with container registries

func NewClientWithOptions

func NewClientWithOptions(opts *ClientOptions) *Client

NewClientWithOptions creates a new container registry client with advanced options

func (*Client) ExtractImageLayers

func (c *Client) ExtractImageLayers(ctx context.Context, tag string, handler func(pkg.LayerStream) error) error

ExtractImageLayers retrieves uncompressed layer streams for extraction The repository is determined by the chained WithScope() calls The caller is responsible for closing each LayerStream.Reader

func (*Client) GetImage

func (c *Client) GetImage(ctx context.Context, tag string) (v1.Image, error)

GetImage retrieves an image for a specific reference The repository is determined by the chained WithScope() calls

func (*Client) GetImageConfig

func (c *Client) GetImageConfig(ctx context.Context, tag string) (*v1.ConfigFile, error)

GetImageConfig retrieves the image config file containing labels and metadata The repository is determined by the chained WithScope() calls

func (*Client) GetImageLayers

func (c *Client) GetImageLayers(ctx context.Context, tag string) ([]v1.Layer, error)

GetImageLayers retrieves all layers of an image The repository is determined by the chained WithScope() calls

func (*Client) GetLabel

func (c *Client) GetLabel(ctx context.Context, tag, labelKey string) (string, bool, error)

GetLabel retrieves a specific label from image metadata The repository is determined by the chained WithScope() calls

func (*Client) GetManifest

func (c *Client) GetManifest(ctx context.Context, tag string) (*remote.Descriptor, error)

GetManifest retrieves the manifest for a specific image tag The repository is determined by the chained WithScope() calls

func (*Client) GetRegistry

func (c *Client) GetRegistry() string

GetRegistry returns the full registry path (host + scope)

func (*Client) ListRepositories

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

ListRepositories lists all sub-repositories under the current scope The scope is determined by the chained WithScope() calls Returns repository names (tags) under the current scope

func (*Client) ListTags

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

ListTags lists all tags for the current scope The repository is determined by the chained WithScope() calls

func (*Client) WithScope

func (c *Client) WithScope(scope string) pkg.RegistryClient

WithScope creates a new client with an additional scope path segment This method can be chained to build complex paths: client.WithScope("deckhouse").WithScope("ee").WithScope("modules")

type ClientOptions

type ClientOptions struct {
	// RegistryHost is the registry hostname only (e.g., "registry.example.com")
	RegistryHost string

	// Auth provides authentication for registry access (takes precedence over Username/Password/LicenseToken)
	Auth authn.Authenticator

	// Username for basic authentication
	Username string

	// Password for basic authentication
	Password string

	// LicenseToken for Deckhouse license authentication (alternative to Username/Password)
	LicenseToken string

	// Insecure allows connecting to registries over HTTP instead of HTTPS
	Insecure bool

	// TLSSkipVerify skips TLS certificate verification
	TLSSkipVerify bool

	// Logger for client operations
	Logger *log.Logger
}

ClientOptions contains configuration options for the registry client

type LayerStream

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

LayerStream represents a single layer stream for extraction

func NewLayerStream

func NewLayerStream(index, total int, reader io.ReadCloser) *LayerStream

NewLayerStream creates a new LayerStream

func (*LayerStream) GetIndex

func (ls *LayerStream) GetIndex() int

GetIndex returns the current layer index (1-based)

func (*LayerStream) GetReader

func (ls *LayerStream) GetReader() io.ReadCloser

GetReader returns the reader for the layer content

func (*LayerStream) GetTotal

func (ls *LayerStream) GetTotal() int

GetTotal returns the total number of layers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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