distribution

package
v0.1.0-dev Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package distribution implements plugin distribution interface Distribution is the interface to download a plugin version binary for a given OS and architecture combination. E.g., a GCP object location, an OCI compliant image repository, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	// Image is a fully qualified OCI image for the plugin binary.
	Image string

	// AssetURI is a URI of the plugin binary.
	URI string

	// SHA256 hash of the plugin binary.
	Digest string

	// OS of the plugin binary in `GOOS` format.
	OS string

	// Arch of the plugin binary in `GOARCH` format.
	Arch string
}

Artifact points to an individual plugin binary specific to a version and platform.

func ArtifactFromK8sV1alpha1

func ArtifactFromK8sV1alpha1(a cliv1alpha1.Artifact) Artifact

ArtifactFromK8sV1alpha1 returns Artifact from k8sV1alpha1

type ArtifactList

type ArtifactList []Artifact

ArtifactList contains an Artifact object for every supported platform of a version.

func ArtifactListFromK8sV1alpha1

func ArtifactListFromK8sV1alpha1(l cliv1alpha1.ArtifactList) ArtifactList

ArtifactListFromK8sV1alpha1 returns ArtifactList from k8sV1alpha1

type Artifacts

type Artifacts map[string]ArtifactList

Artifacts contains an artifact list for every supported version.

func ArtifactsFromK8sV1alpha1

func ArtifactsFromK8sV1alpha1(m map[string]cliv1alpha1.ArtifactList) Artifacts

ArtifactsFromK8sV1alpha1 returns Artifacts from k8sV1alpha1

func (Artifacts) DescribeArtifact

func (aMap Artifacts) DescribeArtifact(version, os, arch string) (Artifact, error)

DescribeArtifact returns the artifact resource based plugin metadata

func (Artifacts) Fetch

func (aMap Artifacts) Fetch(version, os, arch string) ([]byte, error)

Fetch the binary for a plugin version.

func (Artifacts) FetchTest

func (aMap Artifacts) FetchTest(version, os, arch string) ([]byte, error)

FetchTest the test binary for a plugin version.

func (Artifacts) GetArtifact

func (aMap Artifacts) GetArtifact(version, os, arch string) (Artifact, error)

GetArtifact returns Artifact object

func (Artifacts) GetDigest

func (aMap Artifacts) GetDigest(version, os, arch string) (string, error)

GetDigest returns the SHA256 hash of the binary for a plugin version.

type Distribution

type Distribution interface {
	// Fetch the binary for a plugin version.
	Fetch(version, os, arch string) ([]byte, error)

	// FetchTest the test binary for a plugin version.
	FetchTest(version, os, arch string) ([]byte, error)

	// GetDigest returns the SHA256 hash of the binary for a plugin version.
	GetDigest(version, os, arch string) (string, error)

	// DescribeArtifact returns the artifact resource based plugin metadata
	DescribeArtifact(version, os, arch string) (Artifact, error)
}

Distribution is an interface to download a single plugin binary.

Jump to

Keyboard shortcuts

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