Package experimental is a collection of experimental features that might
have some rough edges to them. Housing experimental features in this package
results in a user accessing these APIs asexperimental.Foo, thereby making
it explicit that the feature is experimental and using them in production
code is at their own risk.
WithGRPCBidiReads provides an [option.ClientOption] that may be passed to
[cloud.google.com/go/storage.NewGRPCClient].
It enables the client to use bi-directional gRPC APIs for downloads rather than the
server streaming API. In particular, it allows users to use the [storage.MultiRangeDownloader]
surface, which requires bi-directional streaming.
The bi-directional API is in private preview; please contact your account manager if
interested.
WithMetricExporter provides a [option.ClientOption] that may be passed to [storage.NewGRPCClient].
Set an alternate client-side metric Exporter to emit metrics through.
Must implement [metric.Exporter]
WithMetricInterval provides a [option.ClientOption] that may be passed to [storage.NewGRPCClient].
It sets how often to emit metrics [metric.WithInterval] when using
[metric.NewPeriodicReader]
When using Cloud Monitoring interval must be at minimum 1 [time.Minute].
WithReadStallTimeout provides a [option.ClientOption] that may be passed to [storage.NewClient].
It enables the client to retry stalled requests when starting a download from
Cloud Storage. If the timeout elapses with no response from the server, the request
is automatically retried.
The timeout is initially set to ReadStallTimeoutConfig.Min. The client tracks
latency across all read requests from the client for each bucket accessed, and can
adjust the timeout higher to the target percentile when latency for request to that
bucket is high.
Currently, this is supported only for downloads ([storage.NewReader] and
[storage.NewRangeReader] calls) and only for the XML API. Other read APIs (gRPC & JSON)
will be supported soon.
ReadStallTimeoutConfig
typeReadStallTimeoutConfigstruct{// Min is the minimum duration of the timeout. The default value is 500ms. Requests// taking shorter than this value to return response headers will never time out.// In general, you should choose a Min value that is greater than the typical value// for the target percentile.Mintime.Duration// TargetPercentile is the percentile to target for the dynamic timeout. The default// value is 0.99. At the default percentile, at most 1% of requests will be timed out// and retried.TargetPercentilefloat64}
ReadStallTimeoutConfig defines the timeout which is adjusted dynamically based on
past observed latencies.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis webpage lists various versions of the experimental package for Google Cloud Storage, with version 1.51.0 being the latest.\u003c/p\u003e\n"],["\u003cp\u003eThe package contains experimental features, identified with the \u003ccode\u003eexperimental\u003c/code\u003e prefix (e.g., \u003ccode\u003eexperimental.Foo\u003c/code\u003e), indicating they may have limitations and should be used cautiously in production.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWithGRPCBidiReads\u003c/code\u003e function allows using bi-directional gRPC APIs for downloads, which is especially required for features such as \u003ccode\u003estorage.MultiRangeDownloader\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWithMetricExporter\u003c/code\u003e and \u003ccode\u003eWithMetricInterval\u003c/code\u003e functions enable custom metric handling, allowing users to set up alternative metric exporters and define the interval for metric emission.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eWithReadStallTimeout\u003c/code\u003e is a function enabling automatic retries for stalled requests during Cloud Storage downloads using the XML API, with a dynamically adjusted timeout based on observed latencies, controlled by the \u003ccode\u003eReadStallTimeoutConfig\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Package cloud.google.com/go/storage/experimental (v1.51.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.51.0 (latest)](/go/docs/reference/cloud.google.com/go/storage/latest/experimental)\n- [1.50.0](/go/docs/reference/cloud.google.com/go/storage/1.50.0/experimental)\n- [1.49.0](/go/docs/reference/cloud.google.com/go/storage/1.49.0/experimental)\n- [1.48.0](/go/docs/reference/cloud.google.com/go/storage/1.48.0/experimental)\n- [1.47.0](/go/docs/reference/cloud.google.com/go/storage/1.47.0/experimental)\n- [1.46.0](/go/docs/reference/cloud.google.com/go/storage/1.46.0/experimental)\n- [1.45.0](/go/docs/reference/cloud.google.com/go/storage/1.45.0/experimental)\n- [1.44.0](/go/docs/reference/cloud.google.com/go/storage/1.44.0/experimental)\n- [1.43.0](/go/docs/reference/cloud.google.com/go/storage/1.43.0/experimental)\n- [1.42.0](/go/docs/reference/cloud.google.com/go/storage/1.42.0/experimental)\n- [1.41.0](/go/docs/reference/cloud.google.com/go/storage/1.41.0/experimental)\n- [1.40.0](/go/docs/reference/cloud.google.com/go/storage/1.40.0/experimental)\n- [1.39.1](/go/docs/reference/cloud.google.com/go/storage/1.39.1/experimental)\n- [1.38.0](/go/docs/reference/cloud.google.com/go/storage/1.38.0/experimental)\n- [1.37.0](/go/docs/reference/cloud.google.com/go/storage/1.37.0/experimental)\n- [1.36.0](/go/docs/reference/cloud.google.com/go/storage/1.36.0/experimental)\n- [1.35.1](/go/docs/reference/cloud.google.com/go/storage/1.35.1/experimental)\n- [1.34.1](/go/docs/reference/cloud.google.com/go/storage/1.34.1/experimental)\n- [1.33.0](/go/docs/reference/cloud.google.com/go/storage/1.33.0/experimental)\n- [1.32.0](/go/docs/reference/cloud.google.com/go/storage/1.32.0/experimental)\n- [1.31.0](/go/docs/reference/cloud.google.com/go/storage/1.31.0/experimental)\n- [1.30.1](/go/docs/reference/cloud.google.com/go/storage/1.30.1/experimental)\n- [1.29.0](/go/docs/reference/cloud.google.com/go/storage/1.29.0/experimental)\n- [1.28.1](/go/docs/reference/cloud.google.com/go/storage/1.28.1/experimental)\n- [1.27.0](/go/docs/reference/cloud.google.com/go/storage/1.27.0/experimental)\n- [1.26.0](/go/docs/reference/cloud.google.com/go/storage/1.26.0/experimental)\n- [1.25.0](/go/docs/reference/cloud.google.com/go/storage/1.25.0/experimental)\n- [1.24.0](/go/docs/reference/cloud.google.com/go/storage/1.24.0/experimental)\n- [1.23.0](/go/docs/reference/cloud.google.com/go/storage/1.23.0/experimental)\n- [1.22.1](/go/docs/reference/cloud.google.com/go/storage/1.22.1/experimental)\n- [1.21.0](/go/docs/reference/cloud.google.com/go/storage/1.21.0/experimental)\n- [1.20.0](/go/docs/reference/cloud.google.com/go/storage/1.20.0/experimental)\n- [1.19.0](/go/docs/reference/cloud.google.com/go/storage/1.19.0/experimental)\n- [1.18.2](/go/docs/reference/cloud.google.com/go/storage/1.18.2/experimental)\n- [1.17.0](/go/docs/reference/cloud.google.com/go/storage/1.17.0/experimental)\n- [1.16.1](/go/docs/reference/cloud.google.com/go/storage/1.16.1/experimental)\n- [1.15.0](/go/docs/reference/cloud.google.com/go/storage/1.15.0/experimental)\n- [1.14.0](/go/docs/reference/cloud.google.com/go/storage/1.14.0/experimental)\n- [1.13.0](/go/docs/reference/cloud.google.com/go/storage/1.13.0/experimental)\n- [1.12.0](/go/docs/reference/cloud.google.com/go/storage/1.12.0/experimental) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/cloud.google.com/go/storage/experimental). \n\u003cbr /\u003e\n\nPackage experimental is a collection of experimental features that might\nhave some rough edges to them. Housing experimental features in this package\nresults in a user accessing these APIs as `experimental.Foo`, thereby making\nit explicit that the feature is experimental and using them in production\ncode is at their own risk.\n\nAll APIs in this package are experimental. \n\nFunctions\n---------\n\n### func WithGRPCBidiReads\n\n func WithGRPCBidiReads() https://pkg.go.dev/google.golang.org/api/option.https://pkg.go.dev/google.golang.org/api/option#ClientOption\n\nWithGRPCBidiReads provides an \\[option.ClientOption\\] that may be passed to\n\\[cloud.google.com/go/storage.NewGRPCClient\\].\nIt enables the client to use bi-directional gRPC APIs for downloads rather than the\nserver streaming API. In particular, it allows users to use the \\[storage.MultiRangeDownloader\\]\nsurface, which requires bi-directional streaming.\n\nThe bi-directional API is in private preview; please contact your account manager if\ninterested. \n\n### func WithMetricExporter\n\n func WithMetricExporter(ex *https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric.https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric#Exporter) https://pkg.go.dev/google.golang.org/api/option.https://pkg.go.dev/google.golang.org/api/option#ClientOption\n\nWithMetricExporter provides a \\[option.ClientOption\\] that may be passed to \\[storage.NewGRPCClient\\].\nSet an alternate client-side metric Exporter to emit metrics through.\nMust implement \\[metric.Exporter\\] \n\n### func WithMetricInterval\n\n func WithMetricInterval(metricInterval https://pkg.go.dev/time.https://pkg.go.dev/time#Duration) https://pkg.go.dev/google.golang.org/api/option.https://pkg.go.dev/google.golang.org/api/option#ClientOption\n\nWithMetricInterval provides a \\[option.ClientOption\\] that may be passed to \\[storage.NewGRPCClient\\].\nIt sets how often to emit metrics \\[metric.WithInterval\\] when using\n\\[metric.NewPeriodicReader\\]\nWhen using Cloud Monitoring interval must be at minimum 1 \\[time.Minute\\]. \n\n### func WithReadStallTimeout\n\n func WithReadStallTimeout(rstc *#cloud_google_com_go_storage_experimental_ReadStallTimeoutConfig) https://pkg.go.dev/google.golang.org/api/option.https://pkg.go.dev/google.golang.org/api/option#ClientOption\n\nWithReadStallTimeout provides a \\[option.ClientOption\\] that may be passed to \\[storage.NewClient\\].\nIt enables the client to retry stalled requests when starting a download from\nCloud Storage. If the timeout elapses with no response from the server, the request\nis automatically retried.\nThe timeout is initially set to ReadStallTimeoutConfig.Min. The client tracks\nlatency across all read requests from the client for each bucket accessed, and can\nadjust the timeout higher to the target percentile when latency for request to that\nbucket is high.\nCurrently, this is supported only for downloads (\\[storage.NewReader\\] and\n\\[storage.NewRangeReader\\] calls) and only for the XML API. Other read APIs (gRPC \\& JSON)\nwill be supported soon. \n\nReadStallTimeoutConfig\n----------------------\n\n type ReadStallTimeoutConfig struct {\n \t// Min is the minimum duration of the timeout. The default value is 500ms. Requests\n \t// taking shorter than this value to return response headers will never time out.\n \t// In general, you should choose a Min value that is greater than the typical value\n \t// for the target percentile.\n \tMin https://pkg.go.dev/time.https://pkg.go.dev/time#Duration\n\n \t// TargetPercentile is the percentile to target for the dynamic timeout. The default\n \t// value is 0.99. At the default percentile, at most 1% of requests will be timed out\n \t// and retried.\n \tTargetPercentile https://pkg.go.dev/builtin#float64\n }\n\nReadStallTimeoutConfig defines the timeout which is adjusted dynamically based on\npast observed latencies."]]