artifact

package
v0.24.0-dev Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 12 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 NewHTTPArtifact added in v0.16.0

func NewHTTPArtifact(url string) Artifact

NewHTTPArtifact creates HTTP Artifact object

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, error)

NewURIArtifact creates new artifacts based on the URI

type HTTPArtifact added in v0.16.0

type HTTPArtifact struct {
	URL string
}

HTTPArtifact defines HTTP artifact location. Sample URI: https://storage.googleapis.com/tanzu-cli/artifacts/cluster/latest/tanzu-cluster-mac_amd64

func (*HTTPArtifact) Fetch added in v0.16.0

func (g *HTTPArtifact) 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. Sample URI: file://home/user/workspace/tanzu-framework/artifacts/darwin/amd64/cli/login/v0.10.0-dev/tanzu-login-darwin_amd64

func (*LocalArtifact) Fetch

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

Fetch reads the local artifact from its path

type OCIArtifact

type OCIArtifact struct {
	Image string
	// contains filtered or unexported fields
}

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