common

package
v3.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeleteNotSupported = errors.New("delete not supported for this artifact storage, please check" +
	" the following issue for details: https://github.com/argoproj/argo-workflows/issues/3102")

ErrDeleteNotSupported Sentinel error definition for artifact deletion

Functions

func LoadToStream added in v3.4.0

func LoadToStream(a *wfv1.Artifact, g ArtifactDriver) (io.ReadCloser, error)

Use ArtifactDriver.Load() to get a stream, which we can use for all implementations of ArtifactDriver.OpenStream() that aren't yet implemented the "right way" and/or for those that don't have a natural way of streaming

Types

type ArtifactDriver

type ArtifactDriver interface {
	// Load accepts an artifact source URL and places it at specified path
	Load(inputArtifact *v1alpha1.Artifact, path string) error

	// OpenStream opens an artifact for reading. If the artifact is a file,
	// then the file should be opened. If the artifact is a directory, the
	// driver may return that as a tarball. OpenStream is intended to be efficient,
	// so implementations should minimise usage of disk, CPU and memory.
	// Implementations must not implement retry mechanisms. This will be handled by
	// the client, so would result in O(nm) cost.
	OpenStream(a *v1alpha1.Artifact) (io.ReadCloser, error)

	// Save uploads the path to artifact destination
	Save(path string, outputArtifact *v1alpha1.Artifact) error

	Delete(artifact *v1alpha1.Artifact) error

	ListObjects(artifact *v1alpha1.Artifact) ([]string, error)

	IsDirectory(artifact *v1alpha1.Artifact) (bool, error)
}

ArtifactDriver is the interface for loading and saving of artifacts

Jump to

Keyboard shortcuts

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