Skip to content

Latest commit

 

History

History
 
 

cloudfunction

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Example: clusterstatus

This example demonstrates how to use the Elasticsearch Go client with Google Cloud Functions.

Screenshot

Deploy the function with the gcloud command:

$ go mod vendor
$ gcloud functions deploy clusterstatus \
	    --entry-point Health \
	    --runtime go111 \
	    --trigger-http \
	    --memory 128MB \
	    --set-env-vars ELASTICSEARCH_URL=https://...cloud.es.io:9243

Invoke your function over HTTP:

$ curl https://...cloudfunctions.net/clusterstatus

See the function.go file for implementation and the function_test.go file for the example of implementing a mock transport for testing.