package awskit-s3-sim
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b69c81378d08f443a276b947d9a2b45913495cb61b2ff3aa0ad74d6b071f32f8
sha512=50714b8eda6ea6e589eb34a305afdfa4870a5e8e4240c091ff5cecd309c21fdfda6163fb6449caad5cdaf800857369df5da0534d822cf152ac76fc16fb9216e5
doc/awskit-s3-sim/Awskit_s3_sim/index.html
Module Awskit_s3_simSource
Deterministic in-memory S3 implementation for tests.
The simulator implements the same synchronous S3 client shape as runtime-backed clients. It stores objects in memory, records operation history, exposes inspection helpers, and supports deterministic fault injection.
module Clock : sig ... endSimulator configuration. max_list_keys caps list-page sizes when the request does not provide a smaller max_keys.
Validate and create simulator configuration. max_list_keys must be between 1 and 1000.
Like config, but raises Awskit.Error.Awskit_error carrying the structured validation error on validation failure.
Shared in-memory S3 store. Multiple connections can share one store.
Create an empty store using a deterministic clock.
Simulator connection handle.
Connect to a store with credentials used by presigning/signing helpers.
Direct-style runtime used by the simulator.
In-memory simulator request bodies.
module Reader :
Awskit_s3.READER
with type 'a io := 'a
and type t = Runtime.response_body_readerIn-memory simulator response-body readers.
Deterministic fault kinds that can be injected before operations.
Queue one fault for the next applicable operation. Explicit faults are consumed FIFO.
Queue several faults in order. Explicit faults are consumed FIFO.
Enable deterministic pseudo-random faults with probability prob.
Disable random fault injection. Queued explicit faults are unchanged.
type operation_record = {op : [ `Put_object | `Get_object | `Head_object | `Delete_object | `List_objects_v2 | `List_object_versions | `Copy_object | `Delete_objects | `Create_multipart_upload | `Upload_part | `Complete_multipart_upload | `Abort_multipart_upload | `List_parts ];(*Operation kind.
*)bucket : string;(*Bucket targeted by the operation.
*)key : string option;(*Object key targeted by object/multipart operations.
*)timestamp : Ptime.t;(*Simulated operation time.
*)faulted : bool;(*Whether the operation consumed an injected fault.
*)
}Recorded simulator operation.
type object_metadata = {etag : Awskit_s3.Object.Etag.t option;(*Current object ETag.
*)size : int64 option;(*Current object size in bytes.
*)last_modified : Ptime.t option;(*Current object last-modified timestamp.
*)
}Inspectable metadata for the current version of an object.
val object_metadata :
store ->
bucket:Awskit_s3.Bucket_name.t ->
key:Awskit_s3.Object_key.t ->
object_metadata optionReturn metadata for the current object version, if present.
Return current object keys in a bucket in lexicographic order.
Return recorded operations in chronological order.
Return current object bodies as strings in deterministic key order.
module Object :
Awskit_s3.OBJECT
with type connection := t
and type 'a io := 'a
and type request_body := Body.t
and type response_body_reader := Reader.tObject operations against the in-memory simulator store.
Bucket operations against the in-memory simulator store.
module Multipart :
Awskit_s3.MULTIPART
with type connection := t
and type 'a io := 'a
and type request_body := Body.tMultipart operations against the in-memory simulator store.
Presigned request artifact helpers using the simulator connection's credentials and deterministic clock.