helloworld

package module
v0.0.0-...-ec34376 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 8 Imported by: 0

README

Google Cloud Function Test

This is a sample Cloud Function

Example taken from:

The fonctions was extended to generate a metric and call a Prometheus Push Gateway to push the metric to.

Usage

Deploy the function with:

gcloud functions deploy HelloHTTP --runtime go120 --trigger-http --allow-unauthenticated --vpc-connector vpc-access-connector

Check the function is OK:

gcloud functions describe HelloHTTP

Then curl on the URL at httpsTrigger.url like curl -kvs https://us-central1-<project>.cloudfunctions.net/HelloHTTP.

You can pass a value using curl -X POST -kvs https://us-central1-<project>.cloudfunctions.net/HelloHTTP -H "Content-Type:application/json" -d '{"name":"NAME"}'

Check logs using gcloud functions logs read HelloHTTP

Documentation

Overview

Package helloworld provides a set of Cloud Functions samples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelloHTTP

func HelloHTTP(w http.ResponseWriter, r *http.Request)

HelloHTTP is an HTTP Cloud Function with a request parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL