mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 00:33:03 +08:00
S3: Add RequestTimeout in unittest.
This commit is contained in:
@@ -74,7 +74,7 @@ err := store.Set("my-key", []byte("my-value"))
|
|||||||
Or, call `SetWithChecksum()` to create an object with checksum to
|
Or, call `SetWithChecksum()` to create an object with checksum to
|
||||||
ask S3 server to verify data integrity on server side:
|
ask S3 server to verify data integrity on server side:
|
||||||
|
|
||||||
> Currently 4 algorithm are supported:
|
> Currently 4 algorithms are supported:
|
||||||
> - types.ChecksumAlgorithmCrc32 (`CRC32`)
|
> - types.ChecksumAlgorithmCrc32 (`CRC32`)
|
||||||
> - types.ChecksumAlgorithmCrc32c (`CRC32C`)
|
> - types.ChecksumAlgorithmCrc32c (`CRC32C`)
|
||||||
> - types.ChecksumAlgorithmSha1 (`SHA1`)
|
> - types.ChecksumAlgorithmSha1 (`SHA1`)
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
package s3
|
package s3
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
var testStore *Storage
|
var testStore *Storage
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -12,7 +16,7 @@ func init() {
|
|||||||
AccessKey: "minioadmin",
|
AccessKey: "minioadmin",
|
||||||
SecretAccessKey: "minioadmin",
|
SecretAccessKey: "minioadmin",
|
||||||
},
|
},
|
||||||
|
RequestTimeout: 10 * time.Second,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,8 @@ import (
|
|||||||
// Additional methods for S3, but not required by gofiber Storage interface.
|
// Additional methods for S3, but not required by gofiber Storage interface.
|
||||||
|
|
||||||
// SetWithChecksum sets key with value and checksum.
|
// SetWithChecksum sets key with value and checksum.
|
||||||
// Key of `checksum` map is algorithm in upper cases, value is the checksum.
|
//
|
||||||
// Currently only 4 algorithm are supported:
|
// Currently 4 algorithms are supported:
|
||||||
// - types.ChecksumAlgorithmCrc32 (`CRC32`)
|
// - types.ChecksumAlgorithmCrc32 (`CRC32`)
|
||||||
// - types.ChecksumAlgorithmCrc32c (`CRC32C`)
|
// - types.ChecksumAlgorithmCrc32c (`CRC32C`)
|
||||||
// - types.ChecksumAlgorithmSha1 (`SHA1`)
|
// - types.ChecksumAlgorithmSha1 (`SHA1`)
|
||||||
|
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func Test_S3_SetWithChecksum(t *testing.T) {
|
func Test_S3_SetWithChecksum(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
key = "john"
|
key = "set-with-checksum"
|
||||||
val = []byte("doe")
|
val = []byte("doe")
|
||||||
sha256sum = sha256.New().Sum(val)
|
sha256sum = sha256.New().Sum(val)
|
||||||
checksum = map[types.ChecksumAlgorithm][]byte{
|
checksum = map[types.ChecksumAlgorithm][]byte{
|
||||||
|
Reference in New Issue
Block a user