|
48 | 48 | holds arbitrary data as a sequence of bytes, like a file. You\nrefer to objects |
49 | 49 | using a handle, just as with buckets, but unlike buckets\nyou don't explicitly |
50 | 50 | create an object. Instead, the first time you write\nto an object it will be created. |
51 | | - You can use the standard Go <a href=\"/io#Reader\">io.Reader</a>\nand <a href=\"/io#Writer\">io.Writer</a> |
52 | | - interfaces to read and write object data:\n<pre class=\"prettyprint\">obj := bkt.Object("data")\n// |
| 51 | + You can use the standard Go <a href=\"https://pkg.go.dev/io#Reader\">io.Reader</a>\nand |
| 52 | + <a href=\"https://pkg.go.dev/io#Writer\">io.Writer</a> interfaces to read and |
| 53 | + write object data:\n<pre class=\"prettyprint\">obj := bkt.Object("data")\n// |
53 | 54 | Write something to obj.\n// w implements io.Writer.\nw := obj.NewWriter(ctx)\n// |
54 | 55 | Write some text to obj. This will either create the object or overwrite whatever |
55 | 56 | is there already.\nif _, err := fmt.Fprintf(w, "This object contains text.\\n"); |
@@ -124,16 +125,16 @@ items: |
124 | 125 | or\n<li>you are logged into <a href=\"https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login\">gcloud |
125 | 126 | using application default credentials</a>\nwith <a href=\"https://cloud.google.com/sdk/gcloud/reference#--impersonate-service-account\">impersonation |
126 | 127 | enabled</a>.\n</ul>\n<p>Detecting GoogleAccessID may not be possible if you are |
127 | | - authenticated using a\ntoken source or using <a href=\"/google.golang.org/api/option#WithHTTPClient\">option.WithHTTPClient</a>. |
| 128 | + authenticated using a\ntoken source or using <a href=\"https://pkg.go.dev/google.golang.org/api/option#WithHTTPClient\">option.WithHTTPClient</a>. |
128 | 129 | In this case, you can provide a\nservice account email for GoogleAccessID and |
129 | 130 | the client will attempt to sign\nthe URL or Post Policy using that service account.\n<p>To |
130 | 131 | generate the signature, you must have:\n<ul>\n<li>iam.serviceAccounts.signBlob |
131 | 132 | permissions on the GoogleAccessID service\naccount, and\n<li>the <a href=\"https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview\">IAM |
132 | 133 | Service Account Credentials API</a> enabled (unless authenticating\nwith a downloaded |
133 | 134 | private key).\n</ul>\n<h2 id=\"hdr-Errors\">Errors</h2>\n<p>Errors returned by |
134 | | - this client are often of the type <a href=\"/google.golang.org/api/googleapi#Error\">googleapi.Error</a>.\nThese |
135 | | - errors can be introspected for more information by using <a href=\"/errors#As\">errors.As</a>\nwith |
136 | | - the richer <a href=\"/google.golang.org/api/googleapi#Error\">googleapi.Error</a> |
| 135 | + this client are often of the type <a href=\"https://pkg.go.dev/google.golang.org/api/googleapi#Error\">googleapi.Error</a>.\nThese |
| 136 | + errors can be introspected for more information by using <a href=\"https://pkg.go.dev/errors#As\">errors.As</a>\nwith |
| 137 | + the richer <a href=\"https://pkg.go.dev/google.golang.org/api/googleapi#Error\">googleapi.Error</a> |
137 | 138 | type. For example:\n<pre class=\"prettyprint\">var e *googleapi.Error\nif |
138 | 139 | ok := errors.As(err, &e); ok {\n\t if e.Code == 409 { ... }\n}\n</pre>\n<h2 |
139 | 140 | id=\"hdr-Retrying_failed_requests\">Retrying failed requests</h2>\n<p>Methods |
|
0 commit comments