-
Notifications
You must be signed in to change notification settings - Fork 84
/
constants.go
44 lines (35 loc) · 1.6 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package gofakes3
import "time"
const (
// From https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html:
// "The name for a key is a sequence of Unicode characters whose UTF-8
// encoding is at most 1024 bytes long."
KeySizeLimit = 1024
// From https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html:
// Within the PUT request header, the user-defined metadata is limited to 2
// KB in size. The size of user-defined metadata is measured by taking the
// sum of the number of bytes in the UTF-8 encoding of each key and value.
//
// As this does not specify KB or KiB, KB is used in gofakes3. The reason
// for this is if gofakes3 is used for testing, and your tests show that
// 2KiB works, but Amazon uses 2KB... that's a much worse time to discover
// the disparity!
DefaultMetadataSizeLimit = 2000
// Like DefaultMetadataSizeLimit, the docs don't specify MB or MiB, so we
// will accept 5MB for now. The Go client SDK rejects 5MB with the error
// "part size must be at least 5242880 bytes", which is a hint that it
// has been interpreted as MiB at least _somewhere_, but we should remain
// liberal in what we accept in the face of ambiguity.
DefaultUploadPartSize = 5 * 1000 * 1000
DefaultSkewLimit = 15 * time.Minute
MaxUploadsLimit = 1000
DefaultMaxUploads = 1000
MaxUploadPartsLimit = 1000
DefaultMaxUploadParts = 1000
MaxBucketKeys = 1000
DefaultMaxBucketKeys = 1000
MaxBucketVersionKeys = 1000
DefaultMaxBucketVersionKeys = 1000
// From the docs: "Part numbers can be any number from 1 to 10,000, inclusive."
MaxUploadPartNumber = 10000
)