cloudfunctions

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cloudfunctions implements the GCP Cloud Functions v1 REST API as a server.Handler. Real cloud.google.com/go/functions/apiv1 clients configured with a custom endpoint hit this handler the same way they hit cloudfunctions.googleapis.com.

MVP coverage:

POST   /v1/projects/{p}/locations/{l}/functions             — Create (LRO)
GET    /v1/projects/{p}/locations/{l}/functions/{name}      — Get
GET    /v1/projects/{p}/locations/{l}/functions             — List
DELETE /v1/projects/{p}/locations/{l}/functions/{name}      — Delete (LRO)
POST   /v1/projects/{p}/locations/{l}/functions/{name}:call — Synchronous invoke
GET    /v1/operations/{op}                                  — Poll an LRO

All mutating endpoints return Operation envelopes with done=true so SDK pollers terminate on the first response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves GCP Cloud Functions v1 REST requests against a serverless driver.

func New

func New(fn sdrv.Serverless) *Handler

New returns a Cloud Functions handler backed by fn.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches accepts paths that look like Cloud Functions v1: either an LRO poll (/v1/operations/...) or a /v1/projects/{p}/locations/{l}/functions[/...] path. The locations+functions segment guards us from shadowing Firestore's /v1/projects/{p}/databases/... URLs.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes requests by URL shape.

Jump to

Keyboard shortcuts

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