package awskit-s3-sim

  1. Overview
  2. Docs
In-memory simulator for Awskit S3 tests

Install

dune-project
 Dependency

Authors

Maintainers

Sources

awskit-v0.2.0.tbz
sha256=b69c81378d08f443a276b947d9a2b45913495cb61b2ff3aa0ad74d6b071f32f8
sha512=50714b8eda6ea6e589eb34a305afdfa4870a5e8e4240c091ff5cecd309c21fdfda6163fb6449caad5cdaf800857369df5da0534d822cf152ac76fc16fb9216e5

doc/index.html

awskit-s3-sim

awskit-s3-sim provides a deterministic in-memory S3 implementation for tests. Use it when you want S3-shaped behavior without creating buckets, opening network connections, or depending on a local service.

It implements the synchronous Awskit_s3.S client shape and does not perform network IO. It is a simulator for tests and documentation workflows, not live AWS coverage and not a wire-protocol authority.

The public entrypoint is Awskit_s3_sim. The supported simulator surface and security policy are documented in SUPPORT.md and SECURITY.md.

Test Surface

Awskit_s3_sim includes object, bucket, multipart, and presigned operation modules matching runtime-backed S3 clients. It also exposes helpers for common test needs:

  • controllable clock
  • shared in-memory store
  • object metadata and body inspection
  • operation history
  • deterministic and pseudo-random fault injection

Example

let credentials =
  Awskit.Credentials.create_exn
    ~access_key_id:"AK"
    ~secret_access_key:"SK"
    ()
in
let clock = Awskit_s3_sim.Clock.create () in
let store = Awskit_s3_sim.create_store ~clock () in
let conn = Awskit_s3_sim.connect store ~credentials in
let bucket = Awskit_s3.Bucket_name.of_string_exn "test-bucket" in
let key = Awskit_s3.Object_key.of_string_exn "hello.txt" in

ignore
  (Awskit_s3_sim.Bucket.create conn ~bucket ()
   |> Result.get_ok);

ignore
  (Awskit_s3_sim.Object.put_string conn
     ~bucket
     ~key
     ~contents:"hello" ()
   |> Result.get_ok)