zero-cost cloud emulation for Go
Test against real cloud SDKs without a real cloud.
Point the real AWS, Azure, and GCP Go SDKs at an in-memory server that speaks their wire protocols. Production code, unchanged. No mocks, no Docker, no bill.
01 · sdk-compat server
Don't rewrite your tests. Repoint them.
cloudemu speaks the real wire protocols — AWS Query/JSON/Smithy, Azure ARM, GCP REST — over a local httptest.NewServer. Switch the provider tab: the shape stays, one line changes.
- no mocks to maintain
- no Docker to babysit
- no cloud accounts, no bill
cloud := cloudemu.NewAWS()ts := httptest.NewServer(awsserver.New(awsserver.Drivers{ S3: cloud.S3, DynamoDB: cloud.DynamoDB, EC2: cloud.EC2,}))defer ts.Close() // The REAL aws-sdk-go-v2 client — only the endpoint changes.client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.BaseEndpoint = aws.String(ts.URL) o.UsePathStyle = true}) client.PutObject(ctx, &s3.PutObjectInput{ /* production code */ })$
02 · why cloudemu
Three ways to test cloud code. One is free and instant.
| Feature | Real cloud | LocalStack / emulators | cloudemu |
|---|---|---|---|
| Cost | $$$ | $ | Free |
| Speed | seconds | 100ms+ | ~10ms |
| Works offline | ✗ | ✓ | ✓ |
| No Docker | ✓ | ✗ | ✓ |
| Setup | account + creds | Docker + config | go get |
| Realistic behavior | ✓ | ◐ | ✓ |
| Multi-cloud | ✗ | ✗ | ✓ |
| Real SDKs unchanged | ✓ | ✓ | ✓ |
03 · beyond basic mocks
Behavior, not stubs.
Mocks return what you tell them to. cloudemu misbehaves like the real thing — lifecycle rules, throttling, injected outages, clock skew.
- real_sdks
aws-sdk-go-v2, azure-sdk-for-go, and cloud.google.com/go drive an in-memory backend over their actual wire protocols. Nothing to mock, no call sites to rewrite.
- chaos_engineering
Outages, latency spikes, probabilistic failures, throttling — in time-bounded windows. Your retry paths get exercised every run.
- state_machines
VMs enforce real lifecycle transitions; illegal jumps return errors.
- auto_metrics
Launching a VM pushes CPU, network, and disk metrics so alarms evaluate.
- error_injection
Fail always, every Nth call, probabilistically, or the first N calls.
- call_recording
Every call captured with inputs, outputs, errors, timing. Fluent asserts.
- fake_clock
Deterministic TTL expiry, dedup windows, and alarm evaluation.
- zero_deps
Pure Go standard library. Works anywhere Go runs.
04 · coverage
21 domains. 3 providers. All live.
sdk-compat + portable api
every domain is drivable two ways: the portable go api (in-process, no HTTP) or the sdk-compat server (real SDK clients over the wire).
05 · two surfaces
Same backend. Two ways in.
SDK-COMPAT SERVER
21 domains · real wire protocols
ts := httptest.NewServer(awsserver.New(drivers))
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(ts.URL)
})Point the real SDK at a local endpoint. Your production code runs in tests exactly as it ships.
sdk-compat docsPORTABLE GO API
21 domains · in-process, no HTTP
cloud := cloudemu.NewAWS()
cloud.S3.CreateBucket(ctx, "app-data")
cloud.S3.PutObject(ctx, "app-data", "cfg.yaml",
[]byte("port: 8080"), "text/yaml", nil)Typed Go interfaces on the same backend — for setup code, assertions, and tests that skip HTTP altogether.
portable api docsget started
One go get from now, your tests stop needing the internet.
MIT license · Go 1.25+ · zero dependencies