storage

package
v0.0.0-...-b50b54d Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloudStorage

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

func NewGoogleCloudStorage

func NewGoogleCloudStorage(ctx context.Context, bucket string) (*GoogleCloudStorage, error)

func (*GoogleCloudStorage) BucketPath

func (g *GoogleCloudStorage) BucketPath() string

func (*GoogleCloudStorage) Close

func (g *GoogleCloudStorage) Close()

func (*GoogleCloudStorage) IssueSignedUrl

func (g *GoogleCloudStorage) IssueSignedUrl(remotePath string, method string, expires time.Duration) (string, error)

func (*GoogleCloudStorage) UploadFile

func (g *GoogleCloudStorage) UploadFile(reader io.Reader, remotePath string, compress bool) error

type MinioStorage

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

func NewMinioStorage

func NewMinioStorage(ctx context.Context, bucket string) (*MinioStorage, error)

func (*MinioStorage) BucketPath

func (m *MinioStorage) BucketPath() string

func (*MinioStorage) Close

func (m *MinioStorage) Close()

func (*MinioStorage) IssueSignedUrl

func (m *MinioStorage) IssueSignedUrl(remotePath string, method string, expires time.Duration) (string, error)

func (*MinioStorage) UploadFile

func (m *MinioStorage) UploadFile(reader io.Reader, remotePath string, compress bool) error

compress parameter hasn't been implemented for minio client

type MockStorage

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

A mock storage only used for job service testing

func NewMockStorage

func NewMockStorage(ctx context.Context) *MockStorage

func (*MockStorage) BucketPath

func (m *MockStorage) BucketPath() string

func (*MockStorage) Close

func (m *MockStorage) Close()

func (*MockStorage) IssueSignedUrl

func (m *MockStorage) IssueSignedUrl(remotePath string, method string, expires time.Duration) (string, error)

func (*MockStorage) UploadFile

func (m *MockStorage) UploadFile(reader io.Reader, remotePath string, compress bool) error

type Storage

type Storage interface {
	BucketPath() string
	UploadFile(reader io.Reader, remotePath string, compress bool) error
	IssueSignedUrl(remotePath string, method string, expiry time.Duration) (string, error)
	Close()
}

func GetStorage

func GetStorage(ctx context.Context) (Storage, error)

Jump to

Keyboard shortcuts

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