github.com/kubeshop/testkube@v1.17.23/pkg/storage/artifacts.go (about) 1 package storage 2 3 import ( 4 "context" 5 "io" 6 7 "github.com/kubeshop/testkube/pkg/api/v1/testkube" 8 ) 9 10 //go:generate mockgen -destination=./artifacts_mock.go -package=storage "github.com/kubeshop/testkube/pkg/storage" ArtifactsStorage 11 type ArtifactsStorage interface { 12 // ListFiles lists available files in the configured bucket 13 ListFiles(ctx context.Context, executionId, testName, testSuiteName, testWorkflowName string) ([]testkube.Artifact, error) 14 // DownloadFile downloads file from configured 15 DownloadFile(ctx context.Context, file, executionId, testName, testSuiteName, testWorkflowName string) (io.Reader, error) 16 // DownloadArchive downloads archive from configured 17 DownloadArchive(ctx context.Context, executionId string, masks []string) (io.Reader, error) 18 // UploadFile uploads file to configured bucket 19 UploadFile(ctx context.Context, bucketFolder string, filePath string, reader io.Reader, objectSize int64) error 20 // PlaceFiles saves the content of the bucket folders to the filesystem 21 PlaceFiles(ctx context.Context, bucketFolders []string, prefix string) error 22 // GetValidBucketName returns a valid bucket name for the given parent type and name 23 GetValidBucketName(parentType string, parentName string) string 24 }