Documentation
¶
Index ¶
- Constants
- Variables
- func Get(ctx context.Context, uri string, opts ...Option) (io.Reader, string, error)
- type GetOptions
- type Getter
- type Option
- func WithCache(c *cache.DiskCache) Option
- func WithCredentials(username, password string) Option
- func WithInsecureSkipVerifyTLS(skip bool) Option
- func WithLogger(l *slog.Logger) Option
- func WithPassCredentialsAll(pass bool) Option
- func WithRepo(r string) Option
- func WithTimeout(t time.Duration) Option
- func WithVersion(v string) Option
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 ¶
Types ¶
type GetOptions ¶
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 WithCredentials ¶
func WithLogger ¶
func WithPassCredentialsAll ¶
func WithTimeout ¶
func WithVersion ¶
Click to show internal directories.
Click to hide internal directories.