-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,898 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
services/cloud-functions/golang/app1/helloworld/cmd/main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
// Blank-import the function package so the init() runs | ||
_ "example.com/hello" | ||
"github.com/GoogleCloudPlatform/functions-framework-go/funcframework" | ||
) | ||
|
||
func main() { | ||
// Use PORT environment variable, or default to 8080. | ||
port := "8080" | ||
if envPort := os.Getenv("PORT"); envPort != "" { | ||
port = envPort | ||
} | ||
if err := funcframework.Start(port); err != nil { | ||
log.Fatalf("funcframework.Start: %v\n", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module example.com/hello | ||
|
||
go 1.22.1 | ||
|
||
require github.com/GoogleCloudPlatform/functions-framework-go v1.8.1 | ||
|
||
require ( | ||
cloud.google.com/go/functions v1.15.3 // indirect | ||
github.com/cloudevents/sdk-go/v2 v2.14.0 // indirect | ||
github.com/google/uuid v1.4.0 // indirect | ||
github.com/json-iterator/go v1.1.10 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect | ||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect | ||
go.uber.org/atomic v1.4.0 // indirect | ||
go.uber.org/multierr v1.1.0 // indirect | ||
go.uber.org/zap v1.10.0 // indirect | ||
) |
Oops, something went wrong.