ArtifactDriver is the interface for loading and saving of artifacts
| 10 | |
| 11 | // ArtifactDriver is the interface for loading and saving of artifacts |
| 12 | type ArtifactDriver interface { |
| 13 | // Load accepts an artifact source URL and places it at specified path |
| 14 | Load(ctx context.Context, inputArtifact *v1alpha1.Artifact, path string) error |
| 15 | |
| 16 | // OpenStream opens an artifact for reading. If the artifact is a file, |
| 17 | // then the file should be opened. If the artifact is a directory, the |
| 18 | // driver may return that as a tarball. OpenStream is intended to be efficient, |
| 19 | // so implementations should minimise usage of disk, CPU and memory. |
| 20 | // Implementations must not implement retry mechanisms. This will be handled by |
| 21 | // the client, so would result in O(nm) cost. |
| 22 | OpenStream(ctx context.Context, a *v1alpha1.Artifact) (io.ReadCloser, error) |
| 23 | |
| 24 | // Save uploads the path to artifact destination |
| 25 | Save(ctx context.Context, path string, outputArtifact *v1alpha1.Artifact) error |
| 26 | |
| 27 | Delete(ctx context.Context, artifact *v1alpha1.Artifact) error |
| 28 | |
| 29 | ListObjects(ctx context.Context, artifact *v1alpha1.Artifact) ([]string, error) |
| 30 | |
| 31 | IsDirectory(ctx context.Context, artifact *v1alpha1.Artifact) (bool, error) |
| 32 | } |
| 33 | |
| 34 | // ErrDeleteNotSupported Sentinel error definition for artifact deletion |
| 35 | var ErrDeleteNotSupported = errors.New("delete not supported for this artifact storage, please check" + |
no outgoing calls
no test coverage detected