🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/elastic/go-elasticsearch/_examples/cloudfunction

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/elastic/go-elasticsearch/_examples/cloudfunction

v0.0.0-20250430141548-5acbdd84bad3
Version published
Created

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.

FAQs

Package last updated on 30 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts