getter

package
v1.26.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChartLayerMediaType  = "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
	LegacyLayerMediaType = "application/tar+gzip" // Fallback for legacy registries
)

Constants defined by Helm OCI support

View Source
const MaxResponseSize = 100 * 1024 * 1024 // 100MB

Variables

View Source
var (
	// ErrNoHandler is returned when no suitable getter is found for the URL scheme.
	ErrNoHandler = errors.New("no handler found for url")

	// ErrFetchFailed is a generic error for download failures.
	ErrFetchFailed = errors.New("fetch failed")

	// ErrInvalidRepoRef is returned when a repo URL is malformed.
	ErrInvalidRepoRef = errors.New("invalid repo reference")
)

Functions

func Get

func Get(ctx context.Context, uri string, opts ...Option) (io.Reader, string, error)

Types

type GetOptions

type GetOptions struct {
	URI                   string
	Version               string
	Repo                  string
	InsecureSkipVerifyTLS bool
	Username              string
	Password              string
	PassCredentialsAll    bool
	Timeout               time.Duration
	Logging               *slog.Logger
	Cache                 *cache.DiskCache
}

type Getter

type Getter interface {
	// Get file content by url string. It returns the content as a byte slice, the absolute URI (repo+chart+version), and error if any.
	Get(ctx context.Context, opts GetOptions) (io.Reader, string, error)
}

Getter is an interface to support GET to the specified URI.

func NewOCIGetter

func NewOCIGetter() Getter

type Option

type Option func(*GetOptions) error

func WithCache

func WithCache(c *cache.DiskCache) Option

func WithCredentials

func WithCredentials(username, password string) Option

func WithInsecureSkipVerifyTLS

func WithInsecureSkipVerifyTLS(skip bool) Option

func WithLogger

func WithLogger(l *slog.Logger) Option

func WithPassCredentialsAll

func WithPassCredentialsAll(pass bool) Option

func WithRepo

func WithRepo(r string) Option

func WithTimeout

func WithTimeout(t time.Duration) Option

func WithVersion

func WithVersion(v string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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