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
load
()
profiler/export/main_test.go:71
↓ 1 callers
Function
loadAudioAsPCMBytes
loadAudioAsPCMBytes reads a WAV file and returns PCM bytes with a MIME type.
genai/live/live_conversation_audio_with_audio.go:130
↓ 1 callers
Function
loadPresets
loadPresets inserts some demonstration data into the tables.
spanner/spanner_arrays/main.go:106
↓ 1 callers
Function
lockRetentionPolicy
lockRetentionPolicy locks bucket retention policy.
storage/buckets/lock_retention_policy.go:28
↓ 1 callers
Function
logAndPrintError
(err error)
errorreporting/errorreporting_quickstart/main.go:62
↓ 1 callers
Function
logFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_arithmetic.go:275
↓ 1 callers
Function
logoDetection
logoDetection analyzes a video and extracts logos with their bounding boxes.
videointelligence/annotate/logo_detection.go:32
↓ 1 callers
Function
logoDetectionGCS
logoDetectionGCS analyzes a video and extracts logos with their bounding boxes.
videointelligence/annotate/logo_detection_gcs.go:31
↓ 1 callers
Function
main
()
jobs/v3/quickstart/main.go:30
↓ 1 callers
Function
main
()
jobs/v4/quickstart/main.go:28
↓ 1 callers
Function
main
()
asset/quickstart/batch-get-assets-history/main.go:32
↓ 1 callers
Function
main
()
asset/quickstart/list-assets/main.go:32
↓ 1 callers
Function
main
()
run/jobs/main.go:82
↓ 1 callers
Function
makeAuditLog
(subject string, payload AuditLogProtoPayload)
functions/functionsv2/helloauditlog/hello_auditlog_test.go:30
↓ 1 callers
Function
makeGetRequest
makeGetRequest makes a GET request to the specified Cloud Run endpoint in serviceURL (must be a complete URL) by authenticating with the ID token obta
run/authentication/auth.go:29
↓ 1 callers
Function
makeJWTRequest
[END endpoints_generate_jwt_sa] [START endpoints_jwt_request] makeJWTRequest sends an authorized request to your deployed endpoint.
endpoints/getting-started/client/main.go:113
↓ 1 callers
Function
makePublic
makePublic gives all users read access to an object.
storage/objects/make_public.go:28
↓ 1 callers
Function
mapEntriesFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_object.go:101
↓ 1 callers
Function
mapGetFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_object.go:25
↓ 1 callers
Function
mapKeysFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_object.go:63
↓ 1 callers
Function
mapSetFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_object.go:44
↓ 1 callers
Function
mapValuesFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_object.go:82
↓ 1 callers
Function
markdownHandler
(w http.ResponseWriter, r *http.Request)
run/markdown-preview/renderer/main.go:44
↓ 1 callers
Function
mask
mask deidentifies the input by masking all provided info types with maskingCharacter and prints the result to w.
dlp/snippets/deid/mask.go:29
↓ 1 callers
Function
maxFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_array.go:63
↓ 1 callers
Function
maxLogicalFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_logical.go:155
↓ 1 callers
Function
merge
(cs ...<-chan RegionTag)
regiontag_test.go:85
↓ 1 callers
Function
metadataNamespaces
[START datastore_namespace_run_query]
datastore/snippets/snippet_test.go:679
↓ 1 callers
Function
migrateDB
migrateDB creates the votes table if it does not already exist.
cloudsql/sqlserver/database-sql/cloudsql.go:50
↓ 1 callers
Function
migrateDB
migrateDB creates the votes table if it does not already exist.
cloudsql/postgres/database-sql/cloudsql.go:50
↓ 1 callers
Function
migrateDB
migrateDB creates the votes table if it does not already exist.
cloudsql/mysql/database-sql/cloudsql.go:50
↓ 1 callers
Function
minFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_array.go:44
↓ 1 callers
Function
minLogicalFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_logical.go:174
↓ 1 callers
Function
modFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_arithmetic.go:102
↓ 1 callers
Function
modelSelection
[START speech_transcribe_model_selection]
speech/snippets/model_selection.go:32
↓ 1 callers
Function
modifyInstanceWithExtendedMemory
modifyInstanceWithExtendedMemory sends an instance creation request to the Compute Engine API and waits for it to complete.
compute/instances/custom-machine-type/update_memory.go:31
↓ 1 callers
Function
moveFile
moveFile moves an object into another location.
storage/objects/move_file.go:28
↓ 1 callers
Function
multiLocationsSearch
[END job_keyword_location_search] [START job_multi_locations_search] multiLocationsSearch searches for jobs that fall in the distance of any given loc
jobs/v3/howto/location_based_search_sample.go:276
↓ 1 callers
Function
multipleDocs
(ctx context.Context, client *firestore.Client)
firestore/retrieve_data_query.go:27
↓ 1 callers
Function
multipleInequalitiesQuery
(w io.Writer, projectID string)
firestore/query_multiple_inequality.go:26
↓ 1 callers
Function
multiplyFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_arithmetic.go:64
↓ 1 callers
Function
mustCreateBigqueryTestFiles
(t *testing.T, projectID, datasetID string)
dlp/snippets/inspect/inspect_test.go:125
↓ 1 callers
Function
mustGetenv
(k string)
appengine_flexible/analytics/analytics.go:36
↓ 1 callers
Function
mustGetenv
(k string)
appengine_flexible/go115_and_earlier/analytics/analytics.go:36
↓ 1 callers
Function
myLog
Ballpark to spin for ~0.5ms. Simulates a logging function that is called all over the place by the middleware. It illustrates the case of a function t
profiler/hotmid/main.go:45
↓ 1 callers
Function
myLogBuffer
()
profiler/hotmid/main.go:56
↓ 1 callers
Function
myLogMutexLock
()
profiler/hotmid/main.go:51
↓ 1 callers
Function
myLogWrite
()
profiler/hotmid/main.go:61
↓ 1 callers
Function
newApp
newApp creates a new app, returning an error if either the Cloud IAP certificates or the app's audience field cannot be obtained.
getting-started/authenticating-users/main.go:63
↓ 1 callers
Function
newApp
newApp returns an app with the serviceURI attribute assigned.
run/service-auth/main.go:35
↓ 1 callers
Function
newBetaClient
(t *testing.T)
language/analyze/analyze_test.go:139
↓ 1 callers
Function
newMeta
()
run/service-health/main.go:563
↓ 1 callers
Function
newMuteConfigFixture
newMuteConfigFixture initializes variables in this file with resources to use for testing.
securitycenter/muteconfig/mute_config_test.go:119
↓ 1 callers
Function
newMuteConfigFixture
newMuteConfigFixture initializes variables in this file with resources to use for testing.
securitycenter/muteconfigv2/mute_config_test.go:120
↓ 1 callers
Function
newResource
()
spanner/opentelemetry/spanner_opentelemetry_usage.go:104
↓ 1 callers
Function
newTrainerManager
newTrainerManager spins up a new TrainerManager for interacting with MongoDB.
compute/quickstart/compute_quickstart_sample.go:90
↓ 1 callers
Function
newUniqueRand
()
spanner/spanner_leaderboard/leaderboard.go:44
↓ 1 callers
Function
notEqualAnyFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_array.go:215
↓ 1 callers
Function
notEqualFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_comparison.go:120
↓ 1 callers
Function
notFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_logical.go:110
↓ 1 callers
Function
objectTracking
objectTracking analyzes a video and extracts entities with their bounding boxes.
videointelligence/annotate/object_tracking.go:32
↓ 1 callers
Function
objectTrackingGCS
objectTrackingGCS analyzes a video and extracts entities with their bounding boxes.
videointelligence/annotate/object_tracking_gcs.go:31
↓ 1 callers
Function
occurrencePubsub
occurrencePubsub handles incoming Occurrences using a Cloud Pub/Sub subscription.
container_registry/container_analysis/subscriptions.go:30
↓ 1 callers
Function
offsetSyntaxExample
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:1197
↓ 1 callers
Function
openMultipleObjectsRangedRead
openMultipleObjectsRangedRead reads ranges from multiple objects using transfer manager to download ranges in parallel.
storage/rapid/open_multiple_objects_ranged_read.go:31
↓ 1 callers
Function
openObjectMultipleRangedRead
openObjectMultipleRangedRead opens a single object using MultiRangeDownloader to download multiple ranges.
storage/rapid/open_object_multiple_ranged_read.go:31
↓ 1 callers
Function
openObjectReadFullObject
OpenObjectReadFullObject reads a full object's data from a rapid bucket.
storage/rapid/open_object_read_full_object.go:31
↓ 1 callers
Function
openObjectSingleRangedRead
openObjectSingleRangedRead reads a single range from an object in a rapid bucket.
storage/rapid/open_object_single_ranged_read.go:31
↓ 1 callers
Function
optimisticSubscribe
optimisticSubscribe shows the recommended pattern for optimistically assuming a subscription exists prior to receiving messages.
pubsub/v1samples/subscriptions/optimistic_subscribe.go:32
↓ 1 callers
Function
optimisticSubscribe
optimisticSubscribe shows the recommended pattern for optimistically assuming a subscription exists prior to receiving messages.
pubsub/subscriptions/optimistic_subscribe.go:33
↓ 1 callers
Function
optimizeTours
(projectID string)
routeoptimization/snippets/optimize_tours.go:28
↓ 1 callers
Function
orFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_logical.go:66
↓ 1 callers
Function
paginateCursor
(ctx context.Context, client *firestore.Client)
firestore/query.go:220
↓ 1 callers
Function
pagination
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:859
↓ 1 callers
Function
pairwiseEvaluation
pairwiseEvaluation lets the judge model to compare the responses of two models and pick the better one
vertexai/evaluation/pairwise_evaluation.go:30
↓ 1 callers
Function
parallelFunctionCalling
parallelFunctionCalling shows how to execute multiple function calls in parallel and return their results to the model for generating a complete respo
vertexai/function-calling/functioncalling_parallel.go:32
↓ 1 callers
Function
parseCmd
parseCmd splits a line into a command and optional extra args. n will be set if the extra args can be parsed as an int64.
datastore/tasks/tasks.go:138
↓ 1 callers
Function
parseInstanceName
(instanceName string)
spanner/spanner_snippets/spanner/integration_test.go:1816
↓ 1 callers
Function
partitionQuery
[END firestore_query_collection_group_filter_eq]
firestore/collection_group_query.go:55
↓ 1 callers
Function
patchDataset
patchDataset updates (patches) a dataset by updating its timezone..
healthcare/dataset_patch.go:27
↓ 1 callers
Function
patchFHIRResource
patchFHIRResource patches an FHIR resource to be active or not.
healthcare/fhir_resource_patch.go:29
↓ 1 callers
Function
patchFirewallPriority
patchFirewallPriority modifies the priority of a given firewall rule.
compute/firewall/patch_firewall_priority.go:29
↓ 1 callers
Function
patchHL7V2Message
patchHL7V2Message patches an HL7V2 message.
healthcare/hl7v2_message_patch.go:29
↓ 1 callers
Function
pauseAndResumeAppendableUpload
pauseAndResumeAppendableUpload creates a new unfinalized appendable object, closes the Writer, then re-opens the object for writing using NewWriterFro
storage/rapid/pause_and_resume_appendable_upload.go:31
↓ 1 callers
Function
pauseConnector
(w io.Writer, projectID, region, connectClusterID, connectorID string, opts ...option.ClientOption)
managedkafka/connect/connectors/pause_connector.go:29
↓ 1 callers
Function
pingRequest
pingRequest sends a new gRPC ping request to the server configured in the connection.
run/grpc-ping/request.go:28
↓ 1 callers
Function
pingRequestWithAuth
pingRequestWithAuth mints a new Identity Token for each request. This token has a 1 hour expiry and should be reused. audience must be the auto-assign
run/grpc-ping/request_auth.go:34
↓ 1 callers
Function
pipelineConcepts
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_general.go:1707
↓ 1 callers
Function
pipelineDelete
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_dml.go:47
↓ 1 callers
Function
pipelineInitialization
(w io.Writer, projectID string, databaseID string)
firestore/pipeline_snippets_general.go:1749
↓ 1 callers
Function
pipelineUpdate
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_dml.go:25
↓ 1 callers
Function
plotBoundingBoxes
plotBoundingBoxes downloads the image and overlays bounding boxes.
genai/bounding_box/boundingbox_with_txt_img.go:41
↓ 1 callers
Function
policy
(w io.Writer, projectID, topicID string)
pubsub/v1samples/topics/policy.go:27
↓ 1 callers
Function
policy
(w io.Writer, projectID, subID string)
pubsub/v1samples/subscriptions/policy.go:27
↓ 1 callers
Function
pollOperation
(svc *gke.Service, projectId, opID string)
connectgateway/get_namespace_test.go:87
↓ 1 callers
Function
powFunction
(w io.Writer, client *firestore.Client)
firestore/pipeline_snippets_arithmetic.go:183
↓ 1 callers
Function
predictGPU
predictGPU demonstrates how to run interference on a Gemma2 model deployed to a Vertex AI endpoint with GPU accelerators.
vertexai/gemma2/gemma2_predict_gpu.go:29
↓ 1 callers
Function
predictTPU
predictTPU demonstrates how to run interference on a Gemma2 model deployed to a Vertex AI endpoint with TPU accelerators.
vertexai/gemma2/gemma2_predict_tpu.go:29
↓ 1 callers
Function
predictWithTunedEndpointMock
(w io.Writer, tuningJobName string)
genai/tuning/tuning_examples_test.go:71
↓ 1 callers
Function
preemptionHisory
preemptionHisory gets a list of preemption operations from given zone in a project. Optionally limit the results to instance name.
compute/instances/preemptible/preemptible_history.go:32
← previous
next →
2,101–2,200 of 5,023, ranked by callers