Awskit_s3_simDeterministic 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.
val config :
?max_list_keys:int ->
unit ->
(config, Awskit.Error.t) Stdlib.resultValidate and create simulator configuration. max_list_keys must be between 1 and 1000.
val config_exn : ?max_list_keys:int -> unit -> configLike config, but raises Awskit.Error.Awskit_error carrying the structured validation error on validation failure.
val default_config : configDefault simulator configuration.
Create an empty store using a deterministic clock.
val connect : store -> credentials:Awskit.Credentials.t -> tConnect to a store with credentials used by presigning/signing helpers.
module Runtime : Awskit_s3.RUNTIME with type 'a t = 'a and type connection = tDirect-style runtime used by the simulator.
module Body :
Awskit_s3.BODY with type 'a io := 'a and type t = Runtime.request_bodyIn-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.
val clear_faults : t -> unitRemove queued faults.
val enable_random_faults : t -> seed:int -> prob:float -> unitEnable deterministic pseudo-random faults with probability prob.
val disable_random_faults : t -> unitDisable 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.
val keys : store -> bucket:Awskit_s3.Bucket_name.t -> string listReturn current object keys in a bucket in lexicographic order.
val history : store -> operation_record listReturn recorded operations in chronological order.
val clear_history : store -> unitClear recorded operation history.
val objects_as_strings :
store ->
bucket:Awskit_s3.Bucket_name.t ->
(string * string) listReturn 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.
module Bucket : Awskit_s3.BUCKET with type connection := t and type 'a io := 'aBucket 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.
module Presigned :
Awskit_s3.PRESIGNED with type connection := t and type 'a io := 'aPresigned request artifact helpers using the simulator connection's credentials and deterministic clock.