Simple package to manage your file in Google Cloud Storage
Development by:
- Findryankp
go get github.com/Findryankp/goGcs
package main
import (
"fmt"
"github.com/Findryankp/goGcs"
)
func main() {
//set max file size
goGcs.MaxFileLimit = 10000000
//path your credential
goGcs.GscCredentialFilename = "filecred.json"
bucketName := "bucket_images"
filePathName := "testImage.png"
fileNameInGCS := "testImageBucket.png"
//upload file
if err := goGcs.UploadImage(bucketName, filePathName, fileNameInGCS); err != nil {
fmt.Println(err.Error())
}
//delete file
if err := goGcs.DeleteImage(bucketName, filePathName); err != nil {
fmt.Println(err.Error())
}
}
- Create Your Bucket First
- Generate Key