storage

package
v2.54.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: CC0-1.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	UploadProcess   = "upload"
	DownloadProcess = "download"
)

Variables

This section is empty.

Functions

func NewDrive added in v2.41.0

func NewDrive(ctx context.Context) (*googleDrive, error)

Types

type Buckets

type Buckets interface {
	UploadImage(ctx context.Context, file multipart.File, fileName *string) error
	UploadFile(ctx context.Context, file multipart.File, fileName *string) error

	UploadImageFromLocalPath(ctx context.Context, filePath string, fileName *string, deleteAfterSuccess ...bool) error
	UploadFileFromLocalPath(ctx context.Context, filePath string, fileName *string, deleteAfterSuccess ...bool) error

	UploadImagePublic(ctx context.Context, file multipart.File, fileName *string) error
	UploadFilePublic(ctx context.Context, file multipart.File, fileName *string) error
	UploadImageFromLocalPathPublic(ctx context.Context, filePath string, fileName *string, deleteAfterSuccess ...bool) error
	UploadFileFromLocalPathPublic(ctx context.Context, filePath string, fileName *string, deleteAfterSuccess ...bool) error

	GetSignedURLFile(ctx context.Context, imgPath string) (signedUrl string, err error)
	GetFileFS(ctx context.Context, filePath string) (fs.File, error)

	SetFileExpiredTime(minutes int) Buckets
	SetBucketName(fileName string) Buckets
	SetContentType(contentType string) Buckets

	RollbackProcess(ctx context.Context, fileName string) error
	DeleteFile(ctx context.Context, fileName string) error

	CopyFileToAnotherBucket(ctx context.Context, destBucket, fileName string) error
	GenerateSignedURL(urlType string, path string, expires ...time.Duration) (string, error)
	Close()
}

func NewGCS

func NewGCS(ctx context.Context, bucketName string) (Buckets, error)

Jump to

Keyboard shortcuts

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