download

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package download provides an API for resource download handlers. A download handler is used for downloading resoures. By default the native blob as provided by the access method is the resukt of a download. A download handler can influence the outbound blob format according to the concrete type of the resource. For example, a helm download for a helm artifact stored as oci artifact will not provide the oci format chosen for representing the artifact in OCI but a regular helm archive according to its specification. The sub package handlers provides dedicated packages for standard handlers.

A downloader registry is stores as attribute ATTR_DOWNLOADER_HANDLERS for the OCM context, it is not a static part of the OCM context. The downloaders are basically used by clients requiring access to the effective resource content.

Index

Constants

View Source
const ALL = "*"
View Source
const ATTR_DOWNLOADER_HANDLERS = "github.com/open-component-model/ocm/pkg/contexts/ocm/download"

Variables

View Source
var DefaultRegistry = NewRegistry()

Functions

func Register

func Register(arttype, mediatype string, hdlr Handler)

func RegisterForArtifactType

func RegisterForArtifactType(arttype string, hdlr Handler)

func SetFor

func SetFor(ctx datacontext.Context, registry Registry)

Types

type Handler

type Handler interface {
	Download(p common.Printer, racc cpi.ResourceAccess, path string, fs vfs.FileSystem) (bool, string, error)
}

type Registry

type Registry interface {
	Register(arttype, mediatype string, hdlr Handler)
	Handler
	DownloadAsBlob(p common.Printer, racc cpi.ResourceAccess, path string, fs vfs.FileSystem) (bool, string, error)
}

func For

func For(ctx datacontext.Context) Registry

func NewRegistry

func NewRegistry() Registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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