gcs

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 9 Imported by: 0

README

GCS Manager

A Go library for managing Google Cloud Storage (GCS).

Installation

go get github.com/PrimaKu/gcs

Setup

gcsManager, err := gcs.NewGCSManager(credentialPath) // string
if err != nil {
  log.Fatalf("Failed to create GCS client: %v", err)
}

Upload File

gcsManager.UploadFile(bucketName, fileName, file) // string, string, os.File

Documentation

Overview

Package gcs is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCSManager

type GCSManager interface {
	UploadFile(bucketName, objectName string, file os.File) error
	DeleteFile(bucketName, objectName string) error
	ListFiles(bucketName string) ([]string, error)
	MoveFile(bucketName, srcObjectName, dstObjectName string) error
	DeleteAllFilesInDirectory(bucketName, directory string) error
}

func NewGCSManager

func NewGCSManager(credentialsFile string) (GCSManager, error)

type MockGCSManager added in v1.0.1

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

MockGCSManager is a mock of GCSManager interface.

func NewMockGCSManager added in v1.0.1

func NewMockGCSManager(ctrl *gomock.Controller) *MockGCSManager

NewMockGCSManager creates a new mock instance.

func (*MockGCSManager) DeleteAllFilesInDirectory added in v1.0.1

func (m *MockGCSManager) DeleteAllFilesInDirectory(bucketName, directory string) error

DeleteAllFilesInDirectory mocks base method.

func (*MockGCSManager) DeleteFile added in v1.0.1

func (m *MockGCSManager) DeleteFile(bucketName, objectName string) error

DeleteFile mocks base method.

func (*MockGCSManager) EXPECT added in v1.0.1

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

func (*MockGCSManager) ListFiles added in v1.0.1

func (m *MockGCSManager) ListFiles(bucketName string) ([]string, error)

ListFiles mocks base method.

func (*MockGCSManager) MoveFile added in v1.0.1

func (m *MockGCSManager) MoveFile(bucketName, srcObjectName, dstObjectName string) error

MoveFile mocks base method.

func (*MockGCSManager) UploadFile added in v1.0.1

func (m *MockGCSManager) UploadFile(bucketName, objectName string, file os.File) error

UploadFile mocks base method.

type MockGCSManagerMockRecorder added in v1.0.1

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

MockGCSManagerMockRecorder is the mock recorder for MockGCSManager.

func (*MockGCSManagerMockRecorder) DeleteAllFilesInDirectory added in v1.0.1

func (mr *MockGCSManagerMockRecorder) DeleteAllFilesInDirectory(bucketName, directory interface{}) *gomock.Call

DeleteAllFilesInDirectory indicates an expected call of DeleteAllFilesInDirectory.

func (*MockGCSManagerMockRecorder) DeleteFile added in v1.0.1

func (mr *MockGCSManagerMockRecorder) DeleteFile(bucketName, objectName interface{}) *gomock.Call

DeleteFile indicates an expected call of DeleteFile.

func (*MockGCSManagerMockRecorder) ListFiles added in v1.0.1

func (mr *MockGCSManagerMockRecorder) ListFiles(bucketName interface{}) *gomock.Call

ListFiles indicates an expected call of ListFiles.

func (*MockGCSManagerMockRecorder) MoveFile added in v1.0.1

func (mr *MockGCSManagerMockRecorder) MoveFile(bucketName, srcObjectName, dstObjectName interface{}) *gomock.Call

MoveFile indicates an expected call of MoveFile.

func (*MockGCSManagerMockRecorder) UploadFile added in v1.0.1

func (mr *MockGCSManagerMockRecorder) UploadFile(bucketName, objectName, file interface{}) *gomock.Call

UploadFile indicates an expected call of UploadFile.

Jump to

Keyboard shortcuts

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