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
↓ 7,602 callers
Method
Errorf
Errorf is equivalent to Logf followed by Fail.
internal/testutil/retry.go:93
↓ 1,942 callers
Method
Close
()
vertexai/gemma2/gemma2_test.go:61
↓ 829 callers
Function
SystemTest
SystemTest gets the test context. The test is skipped if the GOLANG_SAMPLES_PROJECT_ID environment variable is not set.
internal/testutil/testutil.go:56
↓ 799 callers
Method
String
String renders an entry structure to the JSON format expected by Cloud Logging.
run/logging-manual/main.go:67
↓ 737 callers
Method
Run
Run executes runs the built binary until terminated or timeout has been reached, and indicates successful execution on return. You can supply extra a
internal/testutil/runmain.go:76
↓ 632 callers
Method
String
Srring returns the custom machine type in form of a string acceptable by Compute Engine API.
compute/instances/custom-machine-type/helper_class.go:128
↓ 544 callers
Method
Reset
()
run/grpc-ping/pkg/api/v1/message.pb.go:77
↓ 472 callers
Method
Error
()
functions/slack/search.go:40
↓ 463 callers
Function
Retry
Retry runs function f for up to maxAttempts times until f returns successfully, and reports whether f was run successfully. It will sleep for the give
internal/testutil/retry.go:30
↓ 345 callers
Method
String
()
spanner/spanner_snippets/spanner/testdata/protos/singer.pb.go:70
↓ 258 callers
Method
Close
()
compute/reservations/mock_shared_project.go:28
↓ 240 callers
Method
GetName
()
internal/pubsub/schemas/us-states.pb.go:84
↓ 231 callers
Function
assertContains
(t *testing.T, out string, sub string)
spanner/spanner_snippets/spanner/integration_test.go:1741
↓ 224 callers
Method
Get
(projID string)
testing/gimmeproj/main.go:56
↓ 217 callers
Method
Do
Do executes the provided http.Request using the default http client
internal/cloudrunci/cloudrunci.go:177
↓ 203 callers
Method
Delete
(context.Context, *computepb.DeleteReservationRequest, ...gax.CallOption)
compute/reservations/mock_shared_project.go:29
↓ 197 callers
Method
Execute
Execute writes the template using the provided data.
getting-started/bookshelf/template.go:46
↓ 186 callers
Method
String
()
profiler/shakesapp/shakesapp/shakesapp.pb.go:77
↓ 144 callers
Function
runSample
(t *testing.T, f sampleFunc, dbName, errMsg string)
spanner/spanner_snippets/spanner/integration_test.go:1422
↓ 131 callers
Method
Create
Creates the Cloud Run job, but does not start it. If an image has not been specified or previously built, it will call Build.
internal/cloudrunci/cloudrunjobs.go:120
↓ 129 callers
Method
Add
(proj string)
testing/gimmeproj/main.go:66
↓ 108 callers
Method
Insert
(context.Context, *computepb.InsertReservationRequest, ...gax.CallOption)
compute/reservations/mock_shared_project.go:30
↓ 98 callers
Method
String
()
bigquery/snippets/managedwriter/exampleproto/sample_data.pb.go:133
↓ 90 callers
Method
NewRequest
(method, url string)
internal/cloudrunci/platform.go:28
↓ 80 callers
Method
Logf
Logf formats its arguments and records it in the error log. The text is only printed for the final unsuccessful run or the first successful run.
internal/testutil/retry.go:100
↓ 73 callers
Method
Cleanup
Cleanup deletes any resources
kms/kms_helpers_test.go:100
↓ 62 callers
Method
GenerateContent
(ctx context.Context, model string, contents []*genai.Content, cfg *genai.GenerateContentConfig)
genai/express_mode/expressmode_with_api_key_test.go:27
↓ 61 callers
Method
CreateTopic
(ctx context.Context, req *managedkafkapb.CreateTopicRequest)
internal/managedkafka/fake/fake.go:125
↓ 57 callers
Method
String
()
appengine/go11x/pubsub/authenicated_push/main_test.go:136
↓ 49 callers
Function
mustGetenv
(k string)
appengine_flexible/pubsub/pubsub.go:85
↓ 47 callers
Function
cleanup
cleanup function deletes all documents inside a collection
getting-started/sessions/main_test.go:68
↓ 44 callers
Function
EndToEndTest
EndToEndTest gets the test context, and sets the test as Parallel. The test is skipped if the GOLANG_SAMPLES_E2E_TEST environment variable is not set.
internal/testutil/testutil.go:69
↓ 42 callers
Function
CreateTestBucket
CreateTestBucket creates a new bucket with the given prefix and registers a cleanup function to delete the bucket and any objects it contains. It is e
internal/testutil/storage_cleaner.go:47
↓ 41 callers
Function
testLocation
testLocation retrieves the GOLANG_SAMPLES_LOCATION environment variable used to determine the region for running the test. Skip the test if the enviro
modelarmor/modelarmor_test.go:43
↓ 34 callers
Method
Name
()
internal/cloudrunci/platform.go:25
↓ 34 callers
Function
UniqueBQName
UniqueBQName returns a more unique name for a BigQuery resource.
bigquery/snippets/bqtestutil/bqtestutil.go:27
↓ 34 callers
Function
randomID
()
spanner/spanner_snippets/spanner/integration_test.go:1811
↓ 33 callers
Function
getUUID
()
media/videostitcher/stitcher_test.go:256
↓ 32 callers
Function
BuildMain
BuildMain builds the main package in the current working directory. If it doesn't build, t.Fatal is called. Test methods calling BuildMain should run
internal/testutil/runmain.go:31
↓ 32 callers
Function
testCleanupSecret
(tb testing.TB, name string)
secretmanager/secretmanager_test.go:205
↓ 31 callers
Method
Built
Built reports whether the build was successful.
internal/testutil/runmain.go:62
↓ 31 callers
Method
Reset
()
spanner/spanner_snippets/spanner/testdata/protos/singer.pb.go:102
↓ 30 callers
Method
String
()
internal/cloudrunci/envvars.go:27
↓ 29 callers
Function
testCleanupTemplate
testCleanupTemplate deletes the specified Model Armor template if it exists, ignoring the error if the template is already deleted.
modelarmor/modelarmor_test.go:180
↓ 28 callers
Function
testLocation
testLocation retrieves the location for testing purposes from the environment variable GOLANG_REGIONAL_SAMPLES_LOCATION. If the environment variable i
parametermanager/regional_samples/regional_parametermanager_test.go:54
↓ 26 callers
Function
testSecret
(tb testing.TB, projectID string)
secretmanager/secretmanager_test.go:115
↓ 25 callers
Function
initTest
(t *testing.T, id string)
spanner/spanner_snippets/spanner/integration_test.go:58
↓ 24 callers
Function
DeleteBucketIfExists
DeleteBucketIfExists deletes a bucket and all its objects.
internal/testutil/storage_cleaner.go:65
↓ 24 callers
Function
NewService
NewService creates a new Service based on the name and projectID provided. It will default to the ManagedPlatform in region us-central1, and build a c
internal/cloudrunci/cloudrunci.go:121
↓ 22 callers
Method
Send
(ctx context.Context, in *Request, opts ...grpc.CallOption)
run/grpc-ping/pkg/api/v1/message.pb.go:202
↓ 22 callers
Function
UniqueBucketName
UniqueBucketName returns a unique name with the test prefix.
internal/testutil/storage_cleaner.go:134
↓ 22 callers
Function
testCleanupRegionalSecret
(tb testing.TB, name string)
secretmanager/secretmanager_test.go:219
↓ 22 callers
Function
testLocation
(tb testing.TB)
secretmanager/secretmanager_test.go:42
↓ 21 callers
Function
deleteProduct
deleteProduct deletes a product.
vision/product_search/delete_product.go:30
↓ 21 callers
Function
getOrCreateTopic
getOrCreateTopic gets a topic or creates it if it doesn't exist.
pubsub/v1samples/subscriptions/subscription_test.go:1081
↓ 21 callers
Function
testRegionalSecret
(tb testing.TB, projectID string)
secretmanager/secretmanager_test.go:145
↓ 20 callers
Method
Deploy
Deploy deploys the service to Cloud Run. If an image has not been specified or previously built, it will call Build. If the deployment fails, it tries
internal/cloudrunci/cloudrunci.go:307
↓ 20 callers
Function
setup
(t *testing.T)
pubsub/v1samples/subscriptions/subscription_test.go:58
↓ 19 callers
Function
testClient
(tb testing.TB)
secretmanager/secretmanager_test.go:53
↓ 18 callers
Function
createTopic
createTopic creates a topic if it doesn't exist.
pubsub/subscriptions/subscription_test.go:655
↓ 18 callers
Function
getProjectID
(t *testing.T)
firestore/main_test.go:26
↓ 18 callers
Function
setup
(t *testing.T)
pubsub/subscriptions/subscription_test.go:58
↓ 18 callers
Function
testCleanupParameter
testCleanupParameter deletes the specified parameter in the GCP project. It fails the test if the parameter deletion fails.
parametermanager/parametermanager_test.go:139
↓ 18 callers
Function
testCleanupParameter
testCleanupParameter deletes the specified parameter in the GCP project. It fails the test if the parameter deletion fails.
parametermanager/regional_samples/regional_parametermanager_test.go:163
↓ 17 callers
Function
ContextMain
ContextMain gets a test context from a TestMain function. Useful for initializing global variables before running parallel system tests. ok is false i
internal/testutil/testutil.go:44
↓ 17 callers
Method
RandomID
RandomID returns a random UUID, useful for testing when values need to be unique.
kms/kms_helpers_test.go:166
↓ 17 callers
Function
readWithFilter
[END bigtable_filters_composing_condition] [START bigtable_filters_print]
bigtable/filters/filters.go:161
↓ 16 callers
Method
Clean
Clean deletes the created Cloud Run service.
internal/cloudrunci/cloudrunci.go:358
↓ 16 callers
Method
Reset
()
bigquery/snippets/managedwriter/exampleproto/sample_data.pb.go:124
↓ 16 callers
Function
runSampleWithContext
(ctx context.Context, t *testing.T, f sampleFuncWithContext, dbName, errMsg string)
spanner/spanner_snippets/spanner/integration_test.go:1430
↓ 16 callers
Function
setup
(t *testing.T)
securitycenter/findings/findings_test.go:97
↓ 15 callers
Method
Cleanup
Cleanup deletes any resources.
securitycenter/muteconfig/mute_config_test.go:177
↓ 15 callers
Function
orgID
(t *testing.T)
securitycenter/notificationsv2/notifications_test.go:31
↓ 14 callers
Method
Path
(p ...string)
internal/testutil/testutil.go:36
↓ 14 callers
Method
String
()
endpoints/getting-started-grpc/helloworld/helloworld.pb.go:58
↓ 14 callers
Function
f
(ctx context.Context)
docs/appengine/taskqueue/taskqueue.go:27
↓ 14 callers
Function
parseTime
(rfc3339Time string)
spanner/spanner_snippets/spanner/spanner_insert_graph_data.go:27
↓ 14 callers
Function
setup
(t *testing.T)
pubsub/v1samples/topics/topics_test.go:51
↓ 14 callers
Function
setup
(t *testing.T)
securitycenter/findingsv2/findings_test.go:175
↓ 14 callers
Function
testName
testName generates a unique name for testing purposes by creating a new UUID. It returns the UUID as a string or fails the test if UUID generation fai
parametermanager/parametermanager_test.go:38
↓ 14 callers
Function
testName
testName generates a unique name for testing purposes by creating a new UUID. It returns the UUID as a string or fails the test if UUID generation fai
parametermanager/regional_samples/regional_parametermanager_test.go:41
↓ 14 callers
Function
testRegionalClient
(tb testing.TB)
secretmanager/secretmanager_test.go:64
↓ 13 callers
Method
DeleteTopic
(ctx context.Context, req *managedkafkapb.DeleteTopicRequest)
internal/managedkafka/fake/fake.go:129
↓ 13 callers
Method
Fail
Fail marks the run as failed, and will retry once the function returns.
internal/testutil/retry.go:88
↓ 13 callers
Function
bodyContains
(t *testing.T, wt *webtest.W, path, contains string)
getting-started/bookshelf/main_test.go:242
↓ 13 callers
Function
deleteJob
Deletes the specified job
batch/delete_job.go:28
↓ 13 callers
Function
errorf
[END endpoints_auth_info_backend] errorf writes a swagger-compliant error response.
endpoints/getting-started/app.go:111
↓ 13 callers
Function
setup
(t *testing.T)
pubsub/topics/topics_test.go:53
↓ 13 callers
Function
testParameter
testParameter creates a parameter in the specified GCP project with the given format. It returns the created parameter and its ID or fails the test if
parametermanager/parametermanager_test.go:50
↓ 13 callers
Function
testParameter
testParameter creates a parameter in the specified GCP project with the given format. It returns the created parameter and its ID or fails the test if
parametermanager/regional_samples/regional_parametermanager_test.go:67
↓ 13 callers
Method
version
version returns the execution that the service will be deployed to. This identifier is also used to locate relevant log messages.
internal/cloudrunci/cloudrunjobs.go:114
↓ 12 callers
Method
Create
( ctx context.Context, model string, source *genai.BatchJobSource, config *genai.CreateBatchJobConfig, )
genai/batch_prediction/batchprediction_examples_test.go:31
↓ 12 callers
Method
Get
( ctx context.Context, name string, _ interface{}, )
genai/batch_prediction/batchprediction_examples_test.go:44
↓ 12 callers
Method
Handle
Handle overrides slog.Handler's Handle method. This adds attributes from the span context to the slog.Record.
opentelemetry/instrumentation/app/logger.go:38
↓ 12 callers
Function
cleanupSTSJob
(job *storagetransferpb.TransferJob, projectID string)
storagetransfer/storagetransfer_test.go:556
↓ 12 callers
Function
createTestPgDatabase
(db string, extraStatements ...string)
spanner/spanner_snippets/spanner/integration_test.go:1603
↓ 12 callers
Function
createTestSlate
(slateID string, t *testing.T)
media/videostitcher/stitcher_test.go:308
↓ 12 callers
Function
deleteProductSet
deleteProductSet deletes a product set.
vision/product_search/delete_product_set.go:30
↓ 12 callers
Function
deleteTestSlate
(slateName string, t *testing.T)
media/videostitcher/stitcher_test.go:335
↓ 12 callers
Function
gcloud
gcloud provides a common mechanism for executing gcloud commands. It will attempt to retry failed commands. Use gcloudWithoutRetry() for no retry.
internal/cloudrunci/gcloud.go:41
next →
1–100 of 5,023, ranked by callers