Skip to content

Package simple to upload file, image, etc to Google Cloud Storage

Notifications You must be signed in to change notification settings

findryankp/goGcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Google Cloud Storage - Golang

Simple package to manage your file in Google Cloud Storage

Development by:

  • Findryankp

Import

go get github.com/Findryankp/goGcs

Example

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())
	}
}

Tutorial

  1. Create Your Bucket First
  2. Generate Key

About

Package simple to upload file, image, etc to Google Cloud Storage

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages