artifact

package
v0.13.0-dev Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package artifact implements interface to fetch the binary artifacts from different sources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact interface {
	// Fetch the binary for a plugin version.
	Fetch() ([]byte, error)
}

Artifact is an interface to download a single plugin binary.

func NewGCPArtifact

func NewGCPArtifact(bucket, artifactPath string) Artifact

NewGCPArtifact returns a new GCP storage distribution.

func NewLocalArtifact

func NewLocalArtifact(path string) Artifact

NewLocalArtifact creates Local Artifact object If path is not an absolute path search under `xdg.ConfigHome/tanzu-plugin/distribution` directory

func NewOCIArtifact

func NewOCIArtifact(image string) Artifact

NewOCIArtifact creates OCI Artifact object

func NewURIArtifact

func NewURIArtifact(uri string) Artifact

NewURIArtifact creates new artifacts based on the URI

type GCPArtifact

type GCPArtifact struct {
	// Bucket is a Google Cloud Storage bucket.
	// E.g., tanzu-cli
	Bucket string `json:"bucket"`
	// ArtifactPath is a URI path that is prefixed to the object name/path.
	// E.g., plugins/cluster
	ArtifactPath string `json:"basePath"`
}

GCPArtifact provides a Google Cloud Storage bucket with an optional base path (or object prefix).

func (*GCPArtifact) Fetch

func (g *GCPArtifact) Fetch() ([]byte, error)

Fetch an artifact.

type LocalArtifact

type LocalArtifact struct {
	// Path is path to local binary artifact
	// if path is not an absolute path search under
	// `xdg.ConfigHome/tanzu-plugin/localPath` directory
	Path string
}

LocalArtifact defines local artifact path

func (*LocalArtifact) Fetch

func (l *LocalArtifact) Fetch() ([]byte, error)

Fetch reads the local artifact from its path

type OCIArtifact

type OCIArtifact struct {
	Image string
}

OCIArtifact defines OCI artifact image endpoint

func (*OCIArtifact) Fetch

func (g *OCIArtifact) Fetch() ([]byte, error)

Fetch an artifact.

Jump to

Keyboard shortcuts

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