Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoogleCloudPlatform/golang-samples
/ functions
Functions
5,023 in github.com/GoogleCloudPlatform/golang-samples
⨍
Functions
5,023
◇
Types & classes
329
↓ 1 callers
Function
CleanupSharedModules
CleanupSharedModules deletes all created custom modules.
securitycenter/management_api/event_threat_detection/event_threat_detection_custom_module_test.go:89
↓ 1 callers
Function
ConnectToDatabase
ConnectToDatabase demonstrates how to use go-redis library to connect to a Memorystore Redis instance.
memorystore/snippets/connect_to_db.go:33
↓ 1 callers
Function
ConsumeEventNotification
ConsumeEventNotification demonstrates how to consume and process the Pub/Sub notification from Secret Manager.
secretmanager/consume_event_notification.go:37
↓ 1 callers
Method
CreateAsymmetricDecryptKey
CreateAsymmetricDecryptKey creates a new asymmetric key.
kms/kms_helpers_test.go:189
↓ 1 callers
Method
CreateAsymmetricSignECKey
CreateAsymmetricSignECKey creates a new asymmetric EC key.
kms/kms_helpers_test.go:237
↓ 1 callers
Method
CreateAsymmetricSignRSAKey
CreateAsymmetricSignRSAKey creates a new asymmetric RSA key.
kms/kms_helpers_test.go:213
↓ 1 callers
Method
CreateConnectCluster
Connect server methods
internal/managedkafka/fake/fake.go:178
↓ 1 callers
Method
CreateHSMKey
CreateHSMKey creates a new key backed by an HSM.
kms/kms_helpers_test.go:261
↓ 1 callers
Function
CreateIntent
[END dialogflow_list_intents] [START dialogflow_create_intent]
dialogflow/intent_management/intent_management.go:59
↓ 1 callers
Method
CreateMock
(ctx context.Context)
genai/tuning/tuning_examples_test.go:31
↓ 1 callers
Function
CustomModuleExists
CustomModuleExists checks if a module exists.
securitycenter/management_api/security_health_analytics_custom_module_test.go:174
↓ 1 callers
Function
CustomModuleExists
CustomModuleExists checks if a module exists.
securitycenter/management_api/event_threat_detection/event_threat_detection_custom_module_test.go:132
↓ 1 callers
Function
DB
DB gets a connection to the database. This can panic for malformed database connection strings, invalid credentials, or non-existance database instanc
appengine/go11x/cloudsql/cloudsql.go:54
↓ 1 callers
Function
DefaultTopicConfig
DefaultTopicConfig returns the default topic config for tests.
pubsublite/internal/psltest/util.go:106
↓ 1 callers
Method
Delete
(context.Context, *computepb.DeleteInstanceRequest, ...gax.CallOption)
compute/reservations/mock_shared_project.go:63
↓ 1 callers
Method
DeleteConnectCluster
(ctx context.Context, req *managedkafkapb.DeleteConnectClusterRequest)
internal/managedkafka/fake/fake.go:192
↓ 1 callers
Method
DeleteConnector
(ctx context.Context, req *managedkafkapb.DeleteConnectorRequest)
internal/managedkafka/fake/fake.go:258
↓ 1 callers
Method
DeleteConsumerGroup
(ctx context.Context, req *managedkafkapb.DeleteConsumerGroupRequest)
internal/managedkafka/fake/fake.go:153
↓ 1 callers
Function
DeleteIntent
[END dialogflow_create_intent] [START dialogflow_delete_intent]
dialogflow/intent_management/intent_management.go:102
↓ 1 callers
Method
Deployed
Deployed reports whether the service has been deployed.
internal/cloudrunci/cloudrunci.go:131
↓ 1 callers
Method
Descriptor
()
spanner/spanner_snippets/spanner/testdata/protos/singer.pb.go:74
↓ 1 callers
Function
DetectIntentStream
[END dialogflow_detect_intent_audio] [START dialogflow_detect_intent_streaming]
dialogflow/detect_intent/detect_intent.go:102
↓ 1 callers
Function
DetectIntentText
[START dialogflow_detect_intent_text]
dialogflow/detect_intent/detect_intent.go:29
↓ 1 callers
Function
EnvVar
EnvVar is an example of getting an environment variable in a Go function.
functions/tips/env_var.go:27
↓ 1 callers
Function
ExecutionCount
ExecutionCount is an HTTP Cloud Function that counts how many times it is executed within a specific instance.
functions/http/stateless.go:36
↓ 1 callers
Function
FailedWriteOperation
FailedWriteOperation simulates failure to write data via the provided client
functions/functionsv2/tips/retry.go:89
↓ 1 callers
Function
FailedWriteOperation
FailedWriteOperation simulates failure to write data via the provided client
functions/tips/retry.go:71
↓ 1 callers
Function
FiniteRetryPubSub
FiniteRetryPubSub demonstrates how to avoid inifinite retries.
functions/functionsv2/tips/infinite_retries/infinite_retries.go:49
↓ 1 callers
Function
FiniteRetryPubSub
FiniteRetryPubSub demonstrates how to avoid inifinite retries.
functions/tips/infinite_retries/infinite_retries.go:37
↓ 1 callers
Function
Format
Format formats a KV of a word and its count as a string.
dataflow/flex-templates/wordcount/wordcount.go:85
↓ 1 callers
Function
FormatMessage
Formats a user message
getting-started/devflowapp/services/services.go:90
↓ 1 callers
Method
GenerateContentMock
Mock Vertex AI Search (VAIS) response
genai/tools/tools_examples_test.go:31
↓ 1 callers
Method
GenerateContentMock
(ctx context.Context, model string, contents []*genai.Content, cfg *genai.GenerateContentConfig)
genai/tuning/tuning_examples_test.go:50
↓ 1 callers
Function
GenericHandler
GenericHandler receives and echos a HTTP request's headers and body.
eventarc/generic/main.go:31
↓ 1 callers
Method
GetBody
GetBody performs a GET request to a given path.
getting-started/bookshelf/internal/webtest/webtest.go:65
↓ 1 callers
Method
GetCluster
(ctx context.Context, req *managedkafkapb.GetClusterRequest)
internal/managedkafka/fake/fake.go:97
↓ 1 callers
Method
GetConnectCluster
(ctx context.Context, req *managedkafkapb.GetConnectClusterRequest)
internal/managedkafka/fake/fake.go:201
↓ 1 callers
Method
GetConnector
(ctx context.Context, req *managedkafkapb.GetConnectorRequest)
internal/managedkafka/fake/fake.go:234
↓ 1 callers
Method
GetConsumerGroup
(ctx context.Context, req *managedkafkapb.GetConsumerGroupRequest)
internal/managedkafka/fake/fake.go:157
↓ 1 callers
Method
GetCurrentTime
()
run/grpc-server-streaming/pkg/api/v1/timeservice.pb.go:100
↓ 1 callers
Method
GetDurationSecs
()
run/grpc-server-streaming/pkg/api/v1/timeservice.pb.go:61
↓ 1 callers
Method
GetIndex
()
run/grpc-ping/pkg/api/v1/message.pb.go:102
↓ 1 callers
Function
GetLogEntries
(service *cloudrunci.Service, t *testing.T)
run/testing/sigterm_handler.e2e_test.go:60
↓ 1 callers
Method
GetMessages
Gets the messages that have been sent to a user
getting-started/devflowapp/services/services.go:30
↓ 1 callers
Method
GetReceivedOn
()
run/grpc-ping/pkg/api/v1/message.pb.go:116
↓ 1 callers
Function
Gopher
Gopher prints a gopher.
functions/codelabs/gopher/gopher.go:26
↓ 1 callers
Function
HandleCloudEvent
(w http.ResponseWriter, r *http.Request)
eventarc/audit_iam/main.go:31
↓ 1 callers
Function
HelloContentType
HelloContentType is an HTTP Cloud function. It uses the Content-Type header to identify the request payload format.
functions/http/http_content_type.go:38
↓ 1 callers
Function
HelloEventsPubSub
HelloEventsPubSub receives and processes a Pub/Sub push message.
eventarc/pubsub/main.go:40
↓ 1 callers
Function
HelloEventsStorage
HelloEventsStorage receives and processes a Cloud Audit Log event with Cloud Storage data.
eventarc/audit_storage/main.go:31
↓ 1 callers
Function
HelloFirestore
HelloFirestore is triggered by a change to a Firestore document.
functions/functionsv2/firebase/hellofirestore/hellofirestore.go:35
↓ 1 callers
Function
HelloGCS
HelloGCS consumes a(ny) GCS event.
functions/helloworld/hello_cloud_storage.go:65
↓ 1 callers
Function
HelloGet
HelloGet is an HTTP Cloud Function.
functions/helloworld/hello_world.go:26
↓ 1 callers
Function
HelloHTTP
HelloHTTP is an HTTP Cloud Function with a request parameter.
functions/helloworld/hello_http.go:34
↓ 1 callers
Function
HelloHTTPMethod
HelloHTTPMethod is an HTTP Cloud function. It uses the request method to differentiate the response.
functions/http/http_request_method.go:34
↓ 1 callers
Function
HelloPubSub
HelloPubSub consumes a Pub/Sub message.
functions/helloworld/hello_pubsub.go:33
↓ 1 callers
Function
HelloPubSub
HelloPubSub receives and processes a Pub/Sub push message.
run/image-processing/main.go:56
↓ 1 callers
Function
HelloRTDB
HelloRTDB handles changes to a Firebase RTDB.
functions/functionsv2/firebase/rtdb/rtdb.go:37
↓ 1 callers
Function
HelloRemoteConfig
HelloRemoteConfig handles Firebase Remote Config events.
functions/helloworld/remote_config.go:38
↓ 1 callers
Function
HelloRemoteConfig
HelloRemoteConfig handles Firebase Remote Config events.
functions/functionsv2/firebase/remoteconfig/remoteconfig.go:36
↓ 1 callers
Function
HelloSpanner
HelloSpanner is an example of querying Spanner from a Cloud Function.
functions/spanner/spanner.go:45
↓ 1 callers
Function
HelloWorld
HelloWorld prints the JSON encoded "message" field in the body of the request or "Hello World!" if there isn't one.
functions/console_snippets/http/http.go:29
↓ 1 callers
Method
ImageRepoURL
ImageRepoURL returns the base URL for building docker images
internal/cloudrunci/cloudrunci.go:204
↓ 1 callers
Function
KGSearch
KGSearch uses the Knowledge Graph API to search for a query provided by a Slack command.
functions/slack/search.go:68
↓ 1 callers
Method
KeyString
KeyString converts the environment variables names to a comma-delimited list.
internal/cloudrunci/envvars.go:44
↓ 1 callers
Method
ListBooks
ListBooks returns a list of books, ordered by title.
getting-started/bookshelf/bookshelf.go:40
↓ 1 callers
Method
ListClusters
(ctx context.Context, req *managedkafkapb.ListClustersRequest)
internal/managedkafka/fake/fake.go:103
↓ 1 callers
Method
ListConnectClusters
(ctx context.Context, req *managedkafkapb.ListConnectClustersRequest)
internal/managedkafka/fake/fake.go:207
↓ 1 callers
Method
ListConnectors
(ctx context.Context, req *managedkafkapb.ListConnectorsRequest)
internal/managedkafka/fake/fake.go:243
↓ 1 callers
Method
ListConsumerGroups
(ctx context.Context, req *managedkafkapb.ListConsumerGroupsRequest)
internal/managedkafka/fake/fake.go:163
↓ 1 callers
Function
ListFiles
ListFiles lists the files in the current directory. Uses directory "serverless_function_source_code" as defined in the Go Functions Framework Buildpac
functions/tips/file_system.go:37
↓ 1 callers
Function
ListInstances
(projectId string)
docs/sql/listinstances/listinstances.go:25
↓ 1 callers
Method
ListMock
(ctx context.Context)
genai/tuning/tuning_examples_test.go:116
↓ 1 callers
Function
LookupEntry
LookupEntry provides a simple retry wrapper around the LookupEntry RPC. There's a potential propagation delay from when an entity is created until it
datacatalog/datacatalog_quickstart/main.go:194
↓ 1 callers
Function
MakeRequest
MakeRequest is an example of making an HTTP request. MakeRequest uses a single http.Client for all requests to take advantage of connection pooling an
functions/http/request.go:44
↓ 1 callers
Function
MisconfiguredDataClient
MisconfiguredDataClient simulates failure to retrieve a data storage client.
functions/functionsv2/tips/retry.go:81
↓ 1 callers
Function
MisconfiguredDataClient
MisconfiguredDataClient simulates failure to retrieve a data storage client.
functions/tips/retry.go:63
↓ 1 callers
Function
MustCreateReservation
(ctx context.Context, t *testing.T, client *pubsublite.AdminClient, resPath string)
pubsublite/internal/psltest/util.go:140
↓ 1 callers
Function
New
New creates a web test for a given a host string (e.g. "localhost:8080")
getting-started/bookshelf/internal/webtest/webtest.go:37
↓ 1 callers
Function
NewConn
NewConn creates a new gRPC connection. host should be of the form domain:port, e.g., example.com:443
run/grpc-ping/connection.go:29
↓ 1 callers
Function
NewFakeInstancesServer
(i *computepb.Instance)
functions/functionsv2/label_gce_instance/label_gce_instance_test.go:39
↓ 1 callers
Function
NewKMSFixture
(projectID string)
kms/kms_helpers_test.go:48
↓ 1 callers
Method
NewRequest
NewRequest creates an HTTP request for a URL on the platform.
internal/cloudrunci/platform.go:62
↓ 1 callers
Method
NewRequest
NewRequest creates a new HTTP request to the Render service. If authentication is enabled, an Identity Token is created and added.
run/markdown-preview/editor/render.go:40
↓ 1 callers
Function
NewServer
NewServer returns an implementation of the server for ShakespeareService (defined in shakesapp.proto).
profiler/shakesapp/shakesapp/server.go:38
↓ 1 callers
Function
NewShakespeareServiceClient
(cc grpc.ClientConnInterface)
profiler/shakesapp/shakesapp/shakesapp.pb.go:150
↓ 1 callers
Function
ParseXML
ParseXML is an example of parsing a text/xml request.
functions/http/xml.go:35
↓ 1 callers
Method
PauseConnector
(ctx context.Context, req *managedkafkapb.PauseConnectorRequest)
internal/managedkafka/fake/fake.go:262
↓ 1 callers
Function
PingRequest
[END cloudrun_grpc_request] PingRequest creates a new gRPC request to the upstream ping gRPC service.
run/grpc-ping/request.go:39
↓ 1 callers
Function
PrintAllCreatedModules
PrintAllCreatedModules prints all created custom modules.
securitycenter/management_api/security_health_analytics_custom_module_test.go:118
↓ 1 callers
Function
PrintAllCreatedModules
PrintAllCreatedModules prints all created custom modules.
securitycenter/management_api/event_threat_detection/event_threat_detection_custom_module_test.go:76
↓ 1 callers
Function
PrintTasks
PrintTasks prints the tasks to the given writer.
datastore/tasks/tasks.go:112
↓ 1 callers
Method
RegisterHandlers
RegisterHandlers registers all HTTP handler routes to a new ServeMux.
run/markdown-preview/editor/service.go:73
↓ 1 callers
Function
RegisterShakespeareServiceServer
(s *grpc.Server, srv ShakespeareServiceServer)
profiler/shakesapp/shakesapp/shakesapp.pb.go:177
↓ 1 callers
Method
Render
([]byte)
run/markdown-preview/editor/service.go:31
↓ 1 callers
Method
RestartConnector
(ctx context.Context, req *managedkafkapb.RestartConnectorRequest)
internal/managedkafka/fake/fake.go:274
↓ 1 callers
Method
ResumeConnector
(ctx context.Context, req *managedkafkapb.ResumeConnectorRequest)
internal/managedkafka/fake/fake.go:266
↓ 1 callers
Function
SaveResult
SaveResult is executed when a message is published to the Cloud Pub/Sub topic specified by the RESULT_TOPIC environment vairable, and saves the data p
functions/ocr/app/save.go:29
↓ 1 callers
Function
SaveResult
SaveResult is executed when a message is published to the Cloud Pub/Sub topic specified by the RESULT_TOPIC environment vairable, and saves the data p
functions/functionsv2/ocr/app/save.go:36
↓ 1 callers
Function
ScopeDemo
ScopeDemo is an example of using globally and locally scoped variables in a function.
functions/tips/scope.go:40
← previous
next →
701–800 of 5,023, ranked by callers