package awskit-s3-sim

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

awskit-v0.1.0.tbz
sha256=788e91d57b9eed047bdef011aec476e94588be20e2e2f1b8495cf48b1a90cf0f
sha512=0d441d599f3f3efb766270258bb4d8c9cd660943eb7f90ced0ec6f61a6790f5fb8977ca5cf87f466d84701ee34dbfdf81fe5043b568a2236411f577e698c6d1e

doc/index.html

awskit-s3-sim

awskit-s3-sim provides a deterministic in-memory S3 implementation for tests. It implements the synchronous Awskit_s3.S client shape and does not perform network IO.

The public entrypoint is Awskit_s3_sim.

Test Surface

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

  • 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

ignore
  (Awskit_s3_sim.Bucket.create conn ~bucket:"test-bucket" ()
   |> Result.get_ok);

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