Documentation
¶
Overview ¶
Package objectstoretest provides an in-process, path-style S3-compatible server for tests that exercise the signing sync object storage backend. It implements only the operations that backend uses and honors the If-Match and If-None-Match conditions, so tests never dial a real bucket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Bucket is the only bucket the server accepts.
Bucket string
// HTTP is the underlying TLS test server.
HTTP *httptest.Server
// PageSize bounds ListObjectsV2 pages so tests can cover pagination.
PageSize int
// BeforeRequest may return a non-zero HTTP status to fail a request
// before it is applied, simulating a provider or network failure.
BeforeRequest func(method, key string) int
// OmitPutETag reports whether a successful PUT response omits its ETag,
// as some S3-compatible services do.
OmitPutETag func(key string) bool
// AfterRequest runs after a request was applied, while no lock is held,
// so a test can simulate a concurrent writer between two requests.
AfterRequest func(method, key string)
// contains filtered or unexported fields
}
Server is a fake S3 bucket served over TLS.
func (*Server) UseAsAWSEnvironment ¶
UseAsAWSEnvironment points the standard AWS SDK environment at this server: it trusts the server certificate, supplies static test credentials, and isolates shared configuration so no test reads the operator's profiles.
Click to show internal directories.
Click to hide internal directories.