storage

package
v1.11.8-beta-02 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package storage is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactsStorage added in v1.10.41

type ArtifactsStorage interface {
	// ListFiles lists available files in the configured bucket
	ListFiles(ctx context.Context, executionId, testName, testSuiteName string) ([]testkube.Artifact, error)
	// DownloadFile downloads file from configured
	DownloadFile(ctx context.Context, file, executionId, testName, testSuiteName string) (io.Reader, error)
	// DownloadArchive downloads archive from configured
	DownloadArchive(ctx context.Context, executionId string, masks []string) (io.Reader, error)
	// UploadFile uploads file to configured bucket
	UploadFile(ctx context.Context, bucketFolder string, filePath string, reader io.Reader, objectSize int64) error
	// PlaceFiles saves the content of the bucket folders to the filesystem
	PlaceFiles(ctx context.Context, bucketFolders []string, prefix string) error
	// GetValidBucketName returns a valid bucket name for the given parent type and name
	GetValidBucketName(parentType string, parentName string) string
}

type Client

type Client interface {
	ClientBucket
	ClientImplicitBucket
}

Client is storage client abstraction

type ClientBucket added in v1.9.3

type ClientBucket interface {
	CreateBucket(ctx context.Context, bucket string) error
	DeleteBucket(ctx context.Context, bucket string, force bool) error
	ListBuckets(ctx context.Context) ([]string, error)
	DownloadFileFromBucket(ctx context.Context, bucket, bucketFolder, file string) (*minio.Object, error)
	DownloadArchiveFromBucket(ctx context.Context, bucket, bucketFolder string, masks []string) (io.Reader, error)
	UploadFileToBucket(ctx context.Context, bucket, bucketFolder, filePath string, reader io.Reader, objectSize int64) error
	GetValidBucketName(parentType string, parentName string) string
	DeleteFileFromBucket(ctx context.Context, bucket, bucketFolder, file string) error
}

ClientBucket is storage client abstraction where you have to specify bucket name

type ClientImplicitBucket added in v1.9.3

type ClientImplicitBucket interface {
	ListFiles(ctx context.Context, bucketFolder string) ([]testkube.Artifact, error)
	SaveFile(ctx context.Context, bucketFolder, filePath string) error
	DownloadFile(ctx context.Context, bucketFolder, file string) (*minio.Object, error)
	DownloadArchive(ctx context.Context, bucketFolder string, masks []string) (io.Reader, error)
	UploadFile(ctx context.Context, bucketFolder string, filePath string, reader io.Reader, objectSize int64) error
	PlaceFiles(ctx context.Context, bucketFolders []string, prefix string) error
	DeleteFile(ctx context.Context, bucketFolder, file string) error
}

ClientImplicitBucket is storage client abstraction where bucket name is provided from config

type MockArtifactsStorage added in v1.10.41

type MockArtifactsStorage struct {
	// contains filtered or unexported fields
}

MockArtifactsStorage is a mock of ArtifactsStorage interface.

func NewMockArtifactsStorage added in v1.10.41

func NewMockArtifactsStorage(ctrl *gomock.Controller) *MockArtifactsStorage

NewMockArtifactsStorage creates a new mock instance.

func (*MockArtifactsStorage) DownloadArchive added in v1.10.45

func (m *MockArtifactsStorage) DownloadArchive(arg0 context.Context, arg1 string, arg2 []string) (io.Reader, error)

DownloadArchive mocks base method.

func (*MockArtifactsStorage) DownloadFile added in v1.10.41

func (m *MockArtifactsStorage) DownloadFile(arg0 context.Context, arg1, arg2, arg3, arg4 string) (io.Reader, error)

DownloadFile mocks base method.

func (*MockArtifactsStorage) EXPECT added in v1.10.41

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockArtifactsStorage) GetValidBucketName added in v1.10.44

func (m *MockArtifactsStorage) GetValidBucketName(arg0, arg1 string) string

GetValidBucketName mocks base method.

func (*MockArtifactsStorage) ListFiles added in v1.10.41

func (m *MockArtifactsStorage) ListFiles(arg0 context.Context, arg1, arg2, arg3 string) ([]testkube.Artifact, error)

ListFiles mocks base method.

func (*MockArtifactsStorage) PlaceFiles added in v1.10.44

func (m *MockArtifactsStorage) PlaceFiles(arg0 context.Context, arg1 []string, arg2 string) error

PlaceFiles mocks base method.

func (*MockArtifactsStorage) UploadFile added in v1.10.44

func (m *MockArtifactsStorage) UploadFile(arg0 context.Context, arg1, arg2 string, arg3 io.Reader, arg4 int64) error

UploadFile mocks base method.

type MockArtifactsStorageMockRecorder added in v1.10.41

type MockArtifactsStorageMockRecorder struct {
	// contains filtered or unexported fields
}

MockArtifactsStorageMockRecorder is the mock recorder for MockArtifactsStorage.

func (*MockArtifactsStorageMockRecorder) DownloadArchive added in v1.10.45

func (mr *MockArtifactsStorageMockRecorder) DownloadArchive(arg0, arg1, arg2 interface{}) *gomock.Call

DownloadArchive indicates an expected call of DownloadArchive.

func (*MockArtifactsStorageMockRecorder) DownloadFile added in v1.10.41

func (mr *MockArtifactsStorageMockRecorder) DownloadFile(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

DownloadFile indicates an expected call of DownloadFile.

func (*MockArtifactsStorageMockRecorder) GetValidBucketName added in v1.10.44

func (mr *MockArtifactsStorageMockRecorder) GetValidBucketName(arg0, arg1 interface{}) *gomock.Call

GetValidBucketName indicates an expected call of GetValidBucketName.

func (*MockArtifactsStorageMockRecorder) ListFiles added in v1.10.41

func (mr *MockArtifactsStorageMockRecorder) ListFiles(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

ListFiles indicates an expected call of ListFiles.

func (*MockArtifactsStorageMockRecorder) PlaceFiles added in v1.10.44

func (mr *MockArtifactsStorageMockRecorder) PlaceFiles(arg0, arg1, arg2 interface{}) *gomock.Call

PlaceFiles indicates an expected call of PlaceFiles.

func (*MockArtifactsStorageMockRecorder) UploadFile added in v1.10.44

func (mr *MockArtifactsStorageMockRecorder) UploadFile(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

UploadFile indicates an expected call of UploadFile.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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