oci

package
v0.0.0-...-cdf0a0a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package oci provides a way to interact with Datadog Packages OCIs.

Index

Constants

View Source
const (
	// RegistryAuthDefault is the default registry authentication method. Under the hood, it uses the Docker configuration.
	RegistryAuthDefault string = "docker"
	// RegistryAuthGCR is the Google Container Registry authentication method.
	RegistryAuthGCR string = "gcr"
	// RegistryAuthPassword is the password registry authentication method.
	RegistryAuthPassword string = "password"
)
View Source
const (
	// AnnotationPackage is the annotiation used to identify the package name.
	AnnotationPackage = "com.datadoghq.package.name"
	// AnnotationVersion is the annotiation used to identify the package version.
	AnnotationVersion = "com.datadoghq.package.version"
	// AnnotationSize is the annotiation used to identify the package size.
	AnnotationSize = "com.datadoghq.package.size"

	// DatadogPackageLayerMediaType is the media type for the main Datadog Package layer.
	DatadogPackageLayerMediaType types.MediaType = "application/vnd.datadog.package.layer.v1.tar+zstd"
	// DatadogPackageConfigLayerMediaType is the media type for the optional Datadog Package config layer.
	DatadogPackageConfigLayerMediaType types.MediaType = "application/vnd.datadog.package.config.layer.v1.tar+zstd"
)

Variables

This section is empty.

Functions

func PackageURL

func PackageURL(env *env.Env, pkg string, version string) string

PackageURL returns the package URL for the given site, package and version.

Types

type DownloadedPackage

type DownloadedPackage struct {
	Image   oci.Image
	Name    string
	Version string
	Size    uint64
}

DownloadedPackage is the downloaded package.

func (*DownloadedPackage) ExtractLayers

func (d *DownloadedPackage) ExtractLayers(mediaType types.MediaType, dir string) error

ExtractLayers extracts the layers of the downloaded package with the given media type to the given directory.

func (*DownloadedPackage) WriteOCILayout

func (d *DownloadedPackage) WriteOCILayout(dir string) (err error)

WriteOCILayout writes the image as an OCI layout to the given directory.

type Downloader

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

Downloader is the Downloader used by the installer to download packages.

func NewDownloader

func NewDownloader(env *env.Env, client *http.Client) *Downloader

NewDownloader returns a new Downloader.

func (*Downloader) Download

func (d *Downloader) Download(ctx context.Context, packageURL string) (*DownloadedPackage, error)

Download downloads the Datadog Package referenced in the given Package struct.

Jump to

Keyboard shortcuts

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