You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/r2/examples/aws/aws-sdk-go.mdx
+106-5Lines changed: 106 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
title: aws-sdk-go
3
3
pcx_content_type: example
4
-
5
4
---
6
5
7
-
import { Render } from"~/components"
6
+
import { Render } from"~/components";
8
7
9
-
<Renderfile="keys" /><br/>
8
+
<Renderfile="keys" />
9
+
<br />
10
10
11
11
This example uses version 2 of the [aws-sdk-go](https://github.com/aws/aws-sdk-go-v2) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
12
12
@@ -16,10 +16,11 @@ Client version `1.73.0` introduced a modification to the default checksum behavi
16
16
To mitigate, users can use `1.72.3` or add the following to their config:
17
17
18
18
```go
19
-
config.WithRequestChecksumCalculation(0)
20
-
config.WithResponseChecksumValidation(0)
19
+
config.WithRequestChecksumCalculation(2)
20
+
config.WithResponseChecksumValidation(2)
21
21
```
22
22
23
+
If checksum is needed, R2 supports `SHA-1` and `SHA-256` algorithms.
23
24
:::
24
25
25
26
```go
@@ -93,6 +94,106 @@ func main() {
93
94
}
94
95
```
95
96
97
+
### With SHA-1/SHA-256 checksum algorithms
98
+
99
+
You can also use SHA-1 and SHA-256 algorithms for checksum.
0 commit comments