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
↓ 2 callers
Function
createTableExplicitSchema
createTableExplicitSchema demonstrates creating a new BigQuery table and specifying a schema.
bigquery/snippets/table/bigquery_create_table.go:27
↓ 2 callers
Function
createTask
createTask creates a new task in your App Engine queue.
appengine/go11x/tasks/create_task/create_task.go:29
↓ 2 callers
Function
createTemplate
(project, templateName string)
compute/reservations/reservations_test.go:32
↓ 2 callers
Function
createTestFinding
(ctx context.Context, client *securitycenter.Client, findingID string, category string)
securitycenter/findings/findings_test.go:37
↓ 2 callers
Function
createTestInstance
helper functions
compute/address/address_test.go:37
↓ 2 callers
Function
createTestKey
Create a key for testing purposes and set environment variables
storage/s3_sdk/s3_gcs_test.go:64
↓ 2 callers
Function
createTestTopic
Creates a pubsub topic for testing and registers a cleanup func to remove it once the test finishes
storage/notifications/notifications_test.go:164
↓ 2 callers
Function
createTopicWithSchema
(w io.Writer, projectID, topicID, schemaID string, encoding pubsubpb.Encoding)
pubsub/schemas/create_topic_with_schema.go:27
↓ 2 callers
Function
createWindowsOSImage
createWindowsOSImage creates a new Windows image from the specified source disk.
compute/instances/windows/create-os-image/create_windows_os_image.go:30
↓ 2 callers
Function
createWorkflow
createWorkflow creates a workflow for testing purposes.
workflows/executions/test_functions.go:29
↓ 2 callers
Function
curlRendition
Curl a rendition.
media/videostitcher/stitcher_test.go:298
↓ 2 callers
Function
dbConfigFromEnv
dbConfigFromEnv reads database configuration from the environment, selecting the provided connType in the configuration.
cloudsql/sqlserver/database-sql/cloudsql_test.go:50
↓ 2 callers
Function
dbConfigFromEnv
dbConfigFromEnv reads database configuration from the environment, selecting the provided connType in the configuration.
cloudsql/postgres/database-sql/cloudsql_test.go:53
↓ 2 callers
Function
dbConfigFromEnv
dbConfigFromEnv reads database configuration from the environment, selecting the provided connType in the configuration.
cloudsql/mysql/database-sql/cloudsql_test.go:53
↓ 2 callers
Function
deIdentifyDeterministicEncryption
deIdentifyDeterministicEncryption de-identifies through deterministic encryption
dlp/snippets/deid/deid_deterministic.go:29
↓ 2 callers
Function
defaultAutoComplete
[END job_auto_complete_job_title] [START job_auto_complete_default] defaultAutoComplete suggests job titles or company display names of given companyN
jobs/v3/howto/auto_complete_sample.go:66
↓ 2 callers
Function
defaultSchemaConfig
(projectID, schemaID, schemaFile string, schemaType pubsub.SchemaType)
pubsub/v1samples/schemas/schemas_test.go:524
↓ 2 callers
Function
defaultSchemaConfig
(projectID, schemaID, schemaFile string, schemaType pubsubpb.Schema_Type)
pubsub/schemas/schemas_test.go:497
↓ 2 callers
Function
delete
(w io.Writer, db string)
spanner/spanner_snippets/spanner/spanner_delete_data.go:26
↓ 2 callers
Function
delete
(w io.Writer, projectID, topicID string)
pubsub/v1samples/topics/delete.go:26
↓ 2 callers
Function
deleteBucket
Helper function to delete a bucket with all their containing objects.
translate/v3/delete_bucket.go:26
↓ 2 callers
Function
deleteChannel
deleteChannel deletes the given channel. channelName should be of the form "projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]".
monitoring/snippets/channel_delete.go:31
↓ 2 callers
Function
deleteCluster
(projectID string, clusterName, region string)
dataproc/dataproc_test.go:32
↓ 2 callers
Function
deleteCompany
deleteCompany deletes an existing company. Companies with existing jobs cannot be deleted until those jobs have been deleted.
jobs/v4/howto/delete_company_sample.go:29
↓ 2 callers
Function
deleteDiskImage
Deletes the specified disk image
compute/disk-images/delete_disk_image.go:28
↓ 2 callers
Function
deleteInspectTemplate
deleteInspectTemplate deletes the given template.
dlp/snippets/template/delete.go:28
↓ 2 callers
Function
deleteInstance
(ctx context.Context, projectId, zone, instanceName string)
compute/instances/create-manage-windows-instances/create_windows_instances_test.go:31
↓ 2 callers
Function
deleteInstanceAndBackups
( t *testing.T, instanceName string, instanceAdmin *instance.InstanceAdminClient, databaseAdmin *database.
spanner/spanner_snippets/spanner/integration_test.go:1691
↓ 2 callers
Function
deleteJob
deleteJob deletes an existing job by its resource name.
jobs/v4/howto/delete_job_sample.go:28
↓ 2 callers
Function
deleteLog
(projectID string)
logging/simplelog/delete_log.go:26
↓ 2 callers
Function
deleteMuteRule
deleteMuteRule deletes a mute configuration given its resource name. Note: Previously muted findings are not affected when a mute config is deleted.
securitycenter/muteconfig/delete_mute_rule.go:30
↓ 2 callers
Function
deleteMuteRule
deleteMuteRule deletes a mute configuration given its resource name. Note: Previously muted findings are not affected when a mute config is deleted.
securitycenter/muteconfigv2/delete_mute_rule.go:30
↓ 2 callers
Function
deleteRegionDisk
(ctx context.Context, projectId, region, diskName string)
compute/snapshots/snapshots_test.go:102
↓ 2 callers
Function
deleteSecurityMarks
deleteSecurityMarks deletes security marks "key_a" and "key_b" from assetName's marks. assetName is the resource path for an asset.
securitycenter/securitymarksv2/delete_security_marks.go:30
↓ 2 callers
Function
deleteSecurityMarks
deleteSecurityMarks deletes security marks "key_a" and "key_b" from assetName's marks. assetName is the resource path for an asset.
securitycenter/assets/delete_security_marks.go:30
↓ 2 callers
Function
deleteSnapshot
deleteSnapshot deletes a snapshot of a disk.
compute/snapshots/delete_snapshot.go:28
↓ 2 callers
Function
deleteStoredInfoTypeAfterTest
(t *testing.T, name string)
dlp/snippets/metadata/metadata_test.go:37
↓ 2 callers
Function
deleteTaxonomy
deleteTaxonomy removes an existing taxonomy resource.
datacatalog/snippets/policytagmanager/delete_taxonomy.go:27
↓ 2 callers
Function
deleteTestKey
Deactivate and delete the given key. Should operate as a teardown method.
storage/s3_sdk/s3_gcs_test.go:83
↓ 2 callers
Function
detectText
detectText detects the text in an image using the Google Vision API.
functions/ocr/app/detect.go:31
↓ 2 callers
Function
detectText
detectText detects the text in an image using the Google Vision API.
functions/functionsv2/ocr/app/detect.go:31
↓ 2 callers
Function
disableCa
Disable a Certificate Authority from the specified CA pool.
privateca/disable_ca.go:28
↓ 2 callers
Function
disableTestFinding
(ctx context.Context, client *securitycenter.Client, findingName string)
securitycenter/findingsv2/findings_test.go:82
↓ 2 callers
Function
downloadProfiles
This function reads profiles for a given project and stores them into locally created files. The profile metadata gets stored into a 'metdata.csv' fil
profiler/export/main.go:48
↓ 2 callers
Function
enableCa
Enable the Certificate Authority present in the given ca pool. CA cannot be enabled if it has been already deleted.
privateca/enable_ca.go:29
↓ 2 callers
Function
enableUniformBucketLevelAccess
enableUniformBucketLevelAccess sets uniform bucket-level access to true.
storage/buckets/enable_uniform_bucket_level_access.go:28
↓ 2 callers
Function
ensureDefaultImageRepo
ensureDefaultImageRepo creates a default docker repo in the given project and location if it does not already exist.
internal/cloudrunci/cloudrunci.go:578
↓ 2 callers
Function
executeWorkflow
Execute a workflow and print the execution results. For more information about Workflows see: https://cloud.google.com/workflows/docs/overview
workflows/executions/execute_workflow.go:31
↓ 2 callers
Function
extractCustomModuleID
extractCustomModuleID extracts the custom module ID from the full name
securitycenter/management_api/security_health_analytics_custom_module_test.go:190
↓ 2 callers
Function
extractCustomModuleID
extractCustomModuleID extracts the custom module ID from the full name
securitycenter/management_api/event_threat_detection/event_threat_detection_custom_module_test.go:148
↓ 2 callers
Function
file_sample_data_proto_rawDescGZIP
()
bigquery/snippets/managedwriter/exampleproto/sample_data.pb.go:325
↓ 2 callers
Function
file_singer_proto_rawDescGZIP
()
spanner/spanner_snippets/spanner/testdata/protos/singer.pb.go:194
↓ 2 callers
Function
findHighSeverityVulnerabilitiesForImage
findHighSeverityVulnerabilitiesForImage retrieves a list of only high vulnerability occurrences associated with a resource.
container_registry/container_analysis/filter_vulnerability_occurrences.go:29
↓ 2 callers
Function
findVulnerabilityOccurrencesForImage
findVulnerabilityOccurrencesForImage retrieves all vulnerability Occurrences associated with a resource.
container_registry/container_analysis/vulnerability_occurrences_for_image.go:29
↓ 2 callers
Function
formatSlackMessage
(query string, response *kgsearch.SearchResponse)
functions/functionsv2/slack/format.go:47
↓ 2 callers
Function
formatSlackMessage
(query string, response *kgsearch.SearchResponse)
functions/slack/format.go:25
↓ 2 callers
Function
formatWithCommas
(n int64)
spanner/spanner_leaderboard/leaderboard.go:271
↓ 2 callers
Function
gcloudExec
gcloudExec adds output prefixing to the execution of the provided command.
internal/cloudrunci/gcloud.go:82
↓ 2 callers
Function
gcloudWithoutRetry
gcloudWithoutRetry provides a common mechanism for executing gcloud commands.
internal/cloudrunci/gcloud.go:77
↓ 2 callers
Function
genPublicKey
Helper function to generate RSA public key
privateca/privateca_test.go:169
↓ 2 callers
Function
generateCannyCtrlTypeWithTextMock
(w io.Writer, outputGCSURI string)
genai/image_generation/image_generation_examples_test.go:122
↓ 2 callers
Function
generateRawReferWithTextMock
(w io.Writer, outputGCSURI string)
genai/image_generation/image_generation_examples_test.go:347
↓ 2 callers
Function
generateScribbleCtrlTypeWithTextMock
(w io.Writer, outputGCSURI string)
genai/image_generation/image_generation_examples_test.go:194
↓ 2 callers
Function
generateStyleRefWithTextMock
(w io.Writer, outputGCSURI string)
genai/image_generation/image_generation_examples_test.go:53
↓ 2 callers
Function
generateSubjRefCtrlReferWithTextMock
(w io.Writer, outputGCSURI string)
genai/image_generation/image_generation_examples_test.go:267
↓ 2 callers
Function
generateTableCTAS
generateTableCTAS creates a quick table by issuing a CREATE TABLE AS SELECT query.
bigquery/snippets/job/integration_test.go:200
↓ 2 callers
Function
generateWorkflowID
generateWorkflowID creates a random string to assign as a Workflow ID.
workflows/executions/test_functions.go:122
↓ 2 callers
Function
getAll
(ctx context.Context, client *firestore.Client, projectID string)
getting-started/background/translate_test.go:130
↓ 2 callers
Function
getCompany
getCompany gets an existing company by its resource name.
jobs/v4/howto/get_company_sample.go:28
↓ 2 callers
Function
getDB
getDB lazily instantiates a database connection pool. Users of Cloud Run or Cloud Functions may wish to skip this lazy instantiation and connect as so
cloudsql/sqlserver/database-sql/cloudsql.go:42
↓ 2 callers
Function
getDB
getDB lazily instantiates a database connection pool. Users of Cloud Run or Cloud Functions may wish to skip this lazy instantiation and connect as so
cloudsql/postgres/database-sql/cloudsql.go:42
↓ 2 callers
Function
getDB
getDB lazily instantiates a database connection pool. Users of Cloud Run or Cloud Functions may wish to skip this lazy instantiation and connect as so
cloudsql/mysql/database-sql/cloudsql.go:42
↓ 2 callers
Function
getDefaultEventBasedHold
getDefaultEventBasedHold gets default event-based hold state.
storage/buckets/get_default_event_based_hold.go:28
↓ 2 callers
Function
getDeleteProtection
getDeleteProtection prints the state of delete protection flag of given instance.
compute/instances/preventing-accidental-vm-deletion/get_delete_protection.go:28
↓ 2 callers
Function
getEntries
(projectID string)
logging/simplelog/list_log_entries.go:30
↓ 2 callers
Function
getFHIRResource
getFHIRResource gets an FHIR resource.
healthcare/fhir_resource_get.go:27
↓ 2 callers
Function
getHealthStr
(enabled, healthy bool)
run/service-health/main.go:281
↓ 2 callers
Function
getJobTemplate
getJobTemplate gets a previously-created job template. See https://cloud.google.com/transcoder/docs/how-to/job-templates#get_job_template for more inf
media/transcoder/get_job_template.go:30
↓ 2 callers
Function
getMuteRule
getMuteRule retrieves a mute configuration given its resource name.
securitycenter/muteconfig/get_mute_rule.go:28
↓ 2 callers
Function
getMuteRule
getMuteRule retrieves a mute configuration given its resource name.
securitycenter/muteconfigv2/get_mute_rule.go:28
↓ 2 callers
Function
getNote
getNote retrieves and prints a specified Note from the server.
container_registry/container_analysis/get_note.go:28
↓ 2 callers
Function
getObjectContexts
getObjectContexts gets an object's contexts.
storage/objects/get_object_contexts.go:28
↓ 2 callers
Function
getOccurrence
getOccurrence retrieves and prints a specified Occurrence from the server.
container_registry/container_analysis/get_occurrence.go:28
↓ 2 callers
Function
getOccurrencesForImage
getOccurrencesForImage retrieves all the Occurrences associated with a specified image. Here, all Occurrences are simply printed and counted.
container_registry/container_analysis/occurrences_for_image.go:31
↓ 2 callers
Function
getOccurrencesForNote
getOccurrencesForNote retrieves all the Occurrences associated with a specified Note. Here, all Occurrences are printed and counted.
container_registry/container_analysis/occurrences_for_note.go:31
↓ 2 callers
Function
getPlayURI
Get the playURI first. The last line of the response will contain a renditions location. Return the renditions.
media/videostitcher/stitcher_test.go:278
↓ 2 callers
Function
getReferenceImage
getReferenceImage gets a reference image.
vision/product_search/get_reference_image.go:30
↓ 2 callers
Function
getReservation
Get certain reservation for given project and zone
compute/reservations/get_reservation.go:28
↓ 2 callers
Function
getSimilarProducts
getSimilarProducts searches for products from a product set similar to products in an image file.
vision/product_search/get_similar_products.go:31
↓ 2 callers
Function
getSimilarProductsURI
getSimilarProductsURI searches for products from a product set similar to products in an image file on GCS.
vision/product_search/get_similar_products_uri.go:30
↓ 2 callers
Function
getTemplate
(project, templateName string)
compute/reservations/reservations_test.go:69
↓ 2 callers
Function
getUniformBucketLevelAccess
getUniformBucketLevelAccess gets uniform bucket-level access.
storage/buckets/get_uniform_bucket_level_access.go:28
↓ 2 callers
Function
grantAccessToResource
grantAccessToResource creates a new ACL conceding the VIEWER role to the group "example-analyst-group@google.com" For more information on the types of
bigquery/bigquery_access_quickstart/grant_access_table_or_view.go:30
↓ 2 callers
Function
grantSTSPermissions
(bucketName string, str *storage.Client)
storagetransfer/storagetransfer_test.go:532
↓ 2 callers
Function
grpcRequest
grpcRequest takes a callback to issue a gRPC request. The returned interface{} can be coerced into the expected *pb.Response.
run/testing/grpc_ping.e2e_test.go:116
↓ 2 callers
Function
guestbookKey
(ctx context.Context)
docs/appengine/datastore/consistency/consistency.go:27
↓ 2 callers
Function
handleHTTP
handleHTTP handles the http HandlerFunc on the specified route, and uses otelhttp for context propagation, trace instrumentation, and metric instrumen
opentelemetry/instrumentation/app/server.go:69
↓ 2 callers
Function
improvedHandler
[END cloudrun_broken_service]
run/hello-broken/main.go:63
↓ 2 callers
Method
incrementCounter
[END firestore_solution_sharded_counter_create] [START firestore_solution_sharded_counter_increment] incrementCounter increments a randomly picked sha
firestore/solution_counters.go:65
↓ 2 callers
Method
index
[END getting_started_sessions_main] [START getting_started_sessions_handler] index uses sessions to assign users a random greeting and keep track of v
getting-started/sessions/main.go:105
← previous
next →
501–600 of 5,023, ranked by callers