Discover Packages
github.com/polds/golang-samples
storage
gcsupload
command
Version:
v0.0.0-...-71aea42
Opens a new window with list of versions in this module.
Published: Jun 5, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
gcsupload
This is a simple CLI that allows you to upload a file to your Google Cloud Storage bucket.
Authentication
Please visit https://cloud.google.com/docs/authentication/getting-started
Installing it
go get -u github.com/GoogleCloudPlatform/golang-samples/storage/gcsupload
Using it
gcsupload -project orijtech-161805 -source ~/Desktop/birthdayPic.jpg -bucket orijtech-gcs-test
which will give you a result like this
URL: https://storage.googleapis.com/orijtech-gcs-test/birthdayPic.jpg
Size: 865096
MD5: 5b6c7b4aed837e8ed0f9950564a10b32
Expand ▾
Collapse ▴
Documentation
¶
gcsupload is a CLI to upload a file to Google Cloud Storage.
Invoke -h to see its flags:
gcsupload -h
Usage of gcsupload:
-bucket string
the bucket to upload content to
-name string
the name of the file to be stored on GCS
-project string
the ID of the GCP project to use
-public
whether the item should be available publicly (default true)
-source string
the path to the source
For example:
gcsupload --project gcs-samples --source ~/Desktop/birthdayPic.jpg --bucket gcs-cli-test
URL: https://storage.googleapis.com/gcs-cli-test/birthdayPic.jpg
Size: 865096
MD5: 5b6c7b4aed837e8ed0f9950564a10b32
Source Files
¶
Click to show internal directories.
Click to hide internal directories.