You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

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

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

v0.0.0-20250521161930-13b824712130
Source
Go
Version published
Created
Source

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 21 May 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