Skip to content

invad0r/google-cloud-functions-in-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Cloud Functions

snippets while following allong two examples using google cloud functions:

# setup gcloud
gcloud services enable cloudfunctions.googleapis.com
# Operation "operations/acf.f452964f-7fe4-42e6-84c0-982bcf373cf6" finished successfully.

# create topic
gcloud alpha pubsub topics create randomNumbers
# Created topic [projects/principal-fact-205806/topics/randomNumbers].

# deploy funciton to gcloud
gcloud alpha functions deploy api \
    --entry-point Send \
    --runtime go111 \
    --trigger-http \
    --set-env-vars PROJECT_ID=principal-fact-205806

gcloud functions deploy consumer \
    --entry-point Consume \
    --runtime go111 \
    --trigger-topic=randomNumbers


gcloud functions logs read consumer

# teardown
gcloud functions delete api
gcloud functions delete consumer
gcloud pubsub topics delete randomNumbers
gcloud functions deploy ResizeImage --runtime go111 --trigger-http

curl 'https://us-central1-principal-fact-205806.cloudfunctions.net/ResizeImage?url=https://github.com/didil/gcf-go-image-resizer/raw/master/example/gopherizeme_orig.jpg&width=10&height=10'

go mod

cd api/
export GO111MODULE=on
go mod init

go mod tidy     # checks which dependencies are used and downloads them#

go mod vendor   # create vendor dir +all deps


go mod graph
go list -m all

go mod why <module> # explain why is needed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages