Documentation ¶
Index ¶
- func Attrs(filePath string) (attrs *storage.ObjectAttrs, err error)
- func CopyFile(src, dst string) error
- func CopyFolder(srcFolder, dstFolder string, multiple bool) error
- func Delete(filePath string) error
- func DeleteFolder(folder string) error
- func DeleteOldFiles(folder string, fileAge time.Duration) error
- func Download(src, dst string) error
- func Exists(filePath string) (bool, error)
- func GetFileReader(object string, optionalBucket ...string) (reader io.Reader, err error)
- func GetSignedURL(objectPath string, duration time.Duration, optionalBucket ...string) (string, error)
- func Init(bucket string)
- func List(prefix string, limit int) (files []string, err error)
- func MD5(filePath string) (md5String string, err error)
- func MakePublic(filePath string) (downloadURL string, err error)
- func ReadFile(filepath string, obj interface{}) (err error)
- func Size(filePath string) (size int64, err error)
- func Upload(localFile, dst string) error
- func UploadFromReader(reader io.Reader, dst string, optionalBucket ...string) error
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attrs ¶
func Attrs(filePath string) (attrs *storage.ObjectAttrs, err error)
Attrs returns the metadata for the bucket.
func CopyFolder ¶
CopyFolder copy cloud storage folder to another dst
func DeleteFolder ¶
DeleteFolder delete all files under folder
func DeleteOldFiles ¶
DeleteOldFiles delete files from folder based on their age, time from created date
func GetFileReader ¶
GetFileReader get file reader from gcp bucket
func GetSignedURL ¶
func GetSignedURL(objectPath string, duration time.Duration, optionalBucket ...string) (string, error)
GetSignedURL get signed url with expire time
func List ¶
List all files in a bucket with a prefix prefix can be a folder, if prefix is empty string the function will return all files in the bucket limit is number of files to retrive, 0 means all
func MakePublic ¶
MakePublic make file public (readonly) and retrive the download url
Types ¶
Click to show internal directories.
Click to hide internal directories.