Summary
The Go template currently only supports Azure Function App. Add GCP Cloud Function as a cloud_service option using the Go Functions Framework (github.com/GoogleCloudPlatform/functions-framework-go). Includes a Firestore repository using cloud.google.com/go/firestore.
Category: gcp, go
Acceptance Criteria
Implementation Notes
Go GCP Dependencies
github.com/GoogleCloudPlatform/functions-framework-go (function hosting)
cloud.google.com/go/firestore (Firestore client)
google.golang.org/api (Google API core)
Key Files to Modify/Create
go/cookiecutter.json — Add "GCP Cloud Function" to choices
go/{{cookiecutter.project_class_name}}/repositories/repository.go — Add Jinja2 conditional for Firestore client
go/{{cookiecutter.project_class_name}}/main.go — Add GCP entry point (Jinja2 conditional, separate from Azure custom handler)
go/{{cookiecutter.project_class_name}}/go.mod — Conditional GCP dependencies
go/hooks/pre_gen_project.py — Input validation (new)
go/hooks/post_gen_project.py — Cloud-specific file cleanup (new)
.github/workflows/build-go-pipeline.yaml — Add GCP Cloud Function to matrix
- Makefile — Add GCP-specific
run command using functions-framework
GCP Cloud Function Entry Point Pattern (Go)
package function
import (
"github.com/GoogleCloudPlatform/functions-framework-go/functions"
"net/http"
)
func init() {
functions.HTTP("GetList", getList)
functions.HTTP("Get", get)
// ... etc
}
Reference
Python and TypeScript templates already support GCP — follow their Jinja2 conditional patterns for consistency.
Summary
The Go template currently only supports Azure Function App. Add GCP Cloud Function as a
cloud_serviceoption using the Go Functions Framework (github.com/GoogleCloudPlatform/functions-framework-go). Includes a Firestore repository usingcloud.google.com/go/firestore.Category:
gcp,goAcceptance Criteria
cookiecutter.jsonincludes"GCP Cloud Function"incloud_servicechoicesgithub.com/GoogleCloudPlatform/functions-framework-gocloud.google.com/go/firestoreSDK implementing all CRUD operationsgo.modconditionally includes GCP dependencies via Jinja2hooks/directory with pre/post gen scripts for input validation and file cleanupGCP_PROJECT_ID,FIRESTORE_DATABASE,FIRESTORE_COLLECTIONGCP Cloud FunctionImplementation Notes
Go GCP Dependencies
github.com/GoogleCloudPlatform/functions-framework-go(function hosting)cloud.google.com/go/firestore(Firestore client)google.golang.org/api(Google API core)Key Files to Modify/Create
go/cookiecutter.json— Add"GCP Cloud Function"to choicesgo/{{cookiecutter.project_class_name}}/repositories/repository.go— Add Jinja2 conditional for Firestore clientgo/{{cookiecutter.project_class_name}}/main.go— Add GCP entry point (Jinja2 conditional, separate from Azure custom handler)go/{{cookiecutter.project_class_name}}/go.mod— Conditional GCP dependenciesgo/hooks/pre_gen_project.py— Input validation (new)go/hooks/post_gen_project.py— Cloud-specific file cleanup (new).github/workflows/build-go-pipeline.yaml— AddGCP Cloud Functionto matrixruncommand using functions-frameworkGCP Cloud Function Entry Point Pattern (Go)
Reference
Python and TypeScript templates already support GCP — follow their Jinja2 conditional patterns for consistency.