Documentation
¶
Overview ¶
Package blobtest is a conformance test-suite for blob.Store implementations. Every backend runs it from its own tests:
func TestConformance(t *testing.T) {
blobtest.Run(t, func(t *testing.T) blob.Store { return newIsolatedStore(t) })
}
newStore is called once per subtest and must return an empty store that no other call shares (a fresh directory, bucket or key prefix). Run closes each store when its subtest ends, so factories should not.
The suite covers reads, writes, overwrites (ETag changes), ranges, listing with and without delimiter, deletion, key validation, unicode keys, content types, concurrency, cancellation, ~1000-object listings and deletes (crossing remote page and batch sizes), and, when the store supports it, presigned PUT/GET round trips over net/http (the download URL must also work without any extra headers, as a redirect target).
Options declare what a backend's presigned uploads enforce, so the suite also checks that wrong-size (PresignEnforcesSize) or wrong-content (PresignEnforcesSHA256) bodies are rejected without storing anything:
blobtest.Run(t, newStore, blobtest.PresignEnforcesSize())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*suite)
Option declares a capability of the store under test.
func PresignEnforcesSHA256 ¶
func PresignEnforcesSHA256() Option
PresignEnforcesSHA256 declares that the storage endpoint also rejects a body of the right size whose SHA-256 differs from PresignPutOptions.SHA256 (S3 with flexible checksums).
func PresignEnforcesSize ¶
func PresignEnforcesSize() Option
PresignEnforcesSize declares that the storage endpoint rejects a PUT to a presigned URL whose body size differs from PresignPutOptions.Size (S3 and GCS do; Azure SAS URLs cannot).
func ReportsPresignedDigests ¶
func ReportsPresignedDigests() Option
ReportsPresignedDigests declares that the store implements blob.DigestReporter and reports the SHA-256 of an object uploaded through a presigned URL that declared one (S3 with flexible checksums).