Documentation ¶
Index ¶
- type GCS
- func (g *GCS) BucketExists(ctx context.Context, bucketName string) (found bool, err error)
- func (g *GCS) Client() interface{}
- func (g *GCS) CopyFile(ctx context.Context, srcBucket, srcPath, destBucket, destPath string) error
- func (g *GCS) CreateBucket(ctx context.Context, bucketName, region string) error
- func (g *GCS) DeleteFile(ctx context.Context, bucketName, fileName string) error
- func (g *GCS) DownloadFile(ctx context.Context, bucketName, objectName, filePath string) error
- func (g *GCS) DownloadFileByProgress(ctx context.Context, bucketName, objectName, filePath string, ...) error
- func (g *GCS) FileExist(ctx context.Context, bucketName, fileName string) bool
- func (g *GCS) FilePath(bucketName, fileName string) string
- func (g *GCS) GetContent(ctx context.Context, bucketName, fileName string) ([]byte, error)
- func (g *GCS) GetFileURL(bucketName, fileName string) string
- func (g *GCS) SignedURL(ctx context.Context, bucketName, fileName string, opts *core.SignedURLOptions) (string, error)
- func (g *GCS) UploadFile(ctx context.Context, bucketName, objectName string, content []byte, ...) error
- func (g *GCS) UploadFileByReader(ctx context.Context, bucketName, objectName string, reader io.Reader, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCS ¶
type GCS struct {
// contains filtered or unexported fields
}
Google Cloud Storage client
func (*GCS) BucketExists ¶
BucketExists Checks if a bucket exists.
func (*GCS) CreateBucket ¶
CreateBucket create bucket
func (*GCS) DeleteFile ¶
DeleteFile delete file
func (*GCS) DownloadFile ¶
DownloadFile downloads and saves the object as a file in the local filesystem.
func (*GCS) DownloadFileByProgress ¶
func (g *GCS) DownloadFileByProgress( ctx context.Context, bucketName, objectName, filePath string, _ *pb.ProgressBar, ) error
DownloadFileByProgress downloads and saves the object as a file in the local filesystem.
func (*GCS) GetContent ¶
GetContent for storage bucket + filename
func (*GCS) GetFileURL ¶
GetFileURL for storage host + bucket + filename
func (*GCS) SignedURL ¶
func (g *GCS) SignedURL(ctx context.Context, bucketName, fileName string, opts *core.SignedURLOptions) (string, error)
SignedURL support signed URL
Click to show internal directories.
Click to hide internal directories.