registry

package
v1.25.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package registry provides intelligence and optimization for container registries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	SupportsMultiArch    bool              `json:"supportsMultiArch"`
	SupportsOCI          bool              `json:"supportsOCI"`
	SupportsZstd         bool              `json:"supportsZstd"`
	SupportsManifestList bool              `json:"supportsManifestList"`
	RateLimits           RateLimitInfo     `json:"rateLimits"`
	RecommendedSettings  RecommendedConfig `json:"recommendedSettings"`
	MaxLayerSize         int64             `json:"maxLayerSize"`
	MaxManifestSize      int64             `json:"maxManifestSize"`
	SupportedPlatforms   []string          `json:"supportedPlatforms"`
	AuthenticationScheme string            `json:"authenticationScheme"`
}

Capabilities defines the capabilities of a registry.

type Intelligence

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

Intelligence manages registry intelligence and optimization.

func NewIntelligence

func NewIntelligence() *Intelligence

NewIntelligence creates a new registry intelligence instance

func (*Intelligence) Cleanup

func (ri *Intelligence) Cleanup()

Cleanup cleans up the registry intelligence cache

func (*Intelligence) DetectCapabilities

func (ri *Intelligence) DetectCapabilities(ctx context.Context, registry string) (Capabilities, error)

DetectCapabilities detects the capabilities of a registry through various methods

func (*Intelligence) GetRegistryRecommendations

func (ri *Intelligence) GetRegistryRecommendations(registry string) map[string]string

GetRegistryRecommendations returns recommendations for using a specific registry

func (*Intelligence) GetRegistryStatistics

func (ri *Intelligence) GetRegistryStatistics() Statistics

GetRegistryStatistics returns statistics about registry usage and performance. This method provides comprehensive metrics about registry operations including cache performance, request counts, and registry type distribution.

func (*Intelligence) OptimizePushStrategy

func (ri *Intelligence) OptimizePushStrategy(registry string, platforms []string) PushStrategy

OptimizePushStrategy determines the optimal push strategy for a registry and platforms

func (*Intelligence) ValidateRegistry

func (ri *Intelligence) ValidateRegistry(ctx context.Context, registry string, requiredCapabilities []string) error

ValidateRegistry validates that a registry is accessible and has the required capabilities.

type PushStrategy

type PushStrategy struct {
	ParallelPushes       bool   `json:"parallelPushes"`
	ChunkSize            int64  `json:"chunkSize"`
	CompressionLevel     int    `json:"compressionLevel"`
	MaxRetries           int    `json:"maxRetries"`
	Timeout              int    `json:"timeout"`
	BackoffAlgorithm     string `json:"backoffAlgorithm"`
	RetryableStatusCodes []int  `json:"retryableStatusCodes"`
	PreferHTTP1_1        bool   `json:"preferHTTP1_1"`
	EnableCache          bool   `json:"enableCache"`
	CacheKey             string `json:"cacheKey"`
}

PushStrategy defines the optimal push strategy for a registry.

type RateLimitInfo

type RateLimitInfo struct {
	RequestsPerMinute int `json:"requestsPerMinute"`
	RequestsPerHour   int `json:"requestsPerHour"`
	RequestsPerDay    int `json:"requestsPerDay"`
	BurstSize         int `json:"burstSize"`
}

RateLimitInfo contains rate limiting information for a registry.

type RecommendedConfig

type RecommendedConfig struct {
	CompressionLevel int    `json:"compressionLevel"`
	ChunkSize        int64  `json:"chunkSize"`
	MaxRetries       int    `json:"maxRetries"`
	Timeout          int    `json:"timeout"`
	ParallelPushes   int    `json:"parallelPushes"`
	EnableCache      bool   `json:"enableCache"`
	CacheTTL         string `json:"cacheTTL"`
}

RecommendedConfig contains recommended configuration for a registry.

type Statistics

type Statistics struct {
	KnownRegistries int    `json:"known_registries"`
	CacheSize       int    `json:"cache_size"`
	CacheHitRate    string `json:"cache_hit_rate"`
	TotalRequests   int    `json:"total_requests"`
	FailedRequests  int    `json:"failed_requests"`
}

Statistics represents statistics about registry usage and performance. This struct provides structured data about registry operations and performance metrics.

Jump to

Keyboard shortcuts

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