Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFullPath ¶
func MD5BytesToString ¶
func ObjectToUrl ¶
func ObjectToUrl(objAttrs *storage.ObjectAttrs) string
Types ¶
type DownloadedFile ¶
DownloadedFile is used when downloading file from Google Could Storage (GCS). Object is the object path that provided from GCS. Name is the file name that you wanted to save locally. Path is where do you want to have your file stored. It should be a full path. Data is raw bytes.
type GCSConfig ¶
type GCSConfig struct { Bucket string `envconfig:"GCS_BUCKET" required:"true"` ProjectID string `envconfig:"GCS_PROJECT_ID" required:"true"` }
func LoadGSCConfig ¶
func LoadGSCConfig() GCSConfig
type GoGCSClient ¶
type GoGCSClient interface { UploadFiles(file []File) ([]UploadedFile, error) DownloadFiles(downloads []DownloadedFile) error RemoveFiles(downloads []DownloadedFile) error }
type GoGSCClient ¶
type GoGSCClient struct { Client *storage.Client ProjectID string Bucket string Context context.Context }
func NewGCSClient ¶
func NewGCSClient(ctx context.Context) *GoGSCClient
func (GoGSCClient) DownloadFiles ¶
func (gcsClient GoGSCClient) DownloadFiles(downloads []DownloadedFile) error
func (GoGSCClient) RemoveFiles ¶
func (gcsClient GoGSCClient) RemoveFiles(downloads []DownloadedFile) error
func (GoGSCClient) UploadFiles ¶
func (gcsClient GoGSCClient) UploadFiles(files []File) ([]UploadedFile, error)
type UploadedFile ¶
Click to show internal directories.
Click to hide internal directories.