diff --git a/01-concurrent-aggregator/.gitignore b/01-context-cancellation-concurrency/01-concurrent-aggregator/.gitignore similarity index 100% rename from 01-concurrent-aggregator/.gitignore rename to 01-context-cancellation-concurrency/01-concurrent-aggregator/.gitignore diff --git a/01-concurrent-aggregator/README.md b/01-context-cancellation-concurrency/01-concurrent-aggregator/README.md similarity index 100% rename from 01-concurrent-aggregator/README.md rename to 01-context-cancellation-concurrency/01-concurrent-aggregator/README.md diff --git a/01-concurrent-aggregator/go.mod b/01-context-cancellation-concurrency/01-concurrent-aggregator/go.mod similarity index 100% rename from 01-concurrent-aggregator/go.mod rename to 01-context-cancellation-concurrency/01-concurrent-aggregator/go.mod diff --git a/03-graceful-shutdown-server/README.md b/01-context-cancellation-concurrency/03-graceful-shutdown-server/README.md similarity index 100% rename from 03-graceful-shutdown-server/README.md rename to 01-context-cancellation-concurrency/03-graceful-shutdown-server/README.md diff --git a/05-context-aware-error-propagator/README.md b/01-context-cancellation-concurrency/05-context-aware-error-propagator/README.md similarity index 100% rename from 05-context-aware-error-propagator/README.md rename to 01-context-cancellation-concurrency/05-context-aware-error-propagator/README.md diff --git a/07-rate-limited-fanout/README.md b/01-context-cancellation-concurrency/07-rate-limited-fanout/README.md similarity index 100% rename from 07-rate-limited-fanout/README.md rename to 01-context-cancellation-concurrency/07-rate-limited-fanout/README.md diff --git a/09-single-flight-ttl-cache/README.md b/01-context-cancellation-concurrency/09-single-flight-ttl-cache/README.md similarity index 100% rename from 09-single-flight-ttl-cache/README.md rename to 01-context-cancellation-concurrency/09-single-flight-ttl-cache/README.md diff --git a/10-worker-pool-errors-join/README.md b/01-context-cancellation-concurrency/10-worker-pool-errors-join/README.md similarity index 100% rename from 10-worker-pool-errors-join/README.md rename to 01-context-cancellation-concurrency/10-worker-pool-errors-join/README.md diff --git a/14-leak-free-scheduler/README.md b/01-context-cancellation-concurrency/14-leak-free-scheduler/README.md similarity index 100% rename from 14-leak-free-scheduler/README.md rename to 01-context-cancellation-concurrency/14-leak-free-scheduler/README.md diff --git a/17-context-aware-channel-sender/README.md b/01-context-cancellation-concurrency/17-context-aware-channel-sender/README.md similarity index 100% rename from 17-context-aware-channel-sender/README.md rename to 01-context-cancellation-concurrency/17-context-aware-channel-sender/README.md diff --git a/02-concurrent-map-with-sharded-locks/README.md b/02-performance-allocation/02-concurrent-map-with-sharded-locks/README.md similarity index 100% rename from 02-concurrent-map-with-sharded-locks/README.md rename to 02-performance-allocation/02-concurrent-map-with-sharded-locks/README.md diff --git a/04-zero-allocation-json-parser/README.md b/02-performance-allocation/04-zero-allocation-json-parser/README.md similarity index 100% rename from 04-zero-allocation-json-parser/README.md rename to 02-performance-allocation/04-zero-allocation-json-parser/README.md diff --git a/11-ndjson-stream-reader/README.md b/02-performance-allocation/11-ndjson-stream-reader/README.md similarity index 100% rename from 11-ndjson-stream-reader/README.md rename to 02-performance-allocation/11-ndjson-stream-reader/README.md diff --git a/12-sync-pool-buffer-middleware/README.md b/02-performance-allocation/12-sync-pool-buffer-middleware/README.md similarity index 100% rename from 12-sync-pool-buffer-middleware/README.md rename to 02-performance-allocation/12-sync-pool-buffer-middleware/README.md diff --git a/06-interface-based-middleware-chain/README.md b/03-http-middleware/06-interface-based-middleware-chain/README.md similarity index 100% rename from 06-interface-based-middleware-chain/README.md rename to 03-http-middleware/06-interface-based-middleware-chain/README.md diff --git a/16-http-client-hygiene/README.md b/03-http-middleware/16-http-client-hygiene/README.md similarity index 100% rename from 16-http-client-hygiene/README.md rename to 03-http-middleware/16-http-client-hygiene/README.md diff --git a/08-retry-backoff-policy/README.md b/04-errors-semantics/08-retry-backoff-policy/README.md similarity index 100% rename from 08-retry-backoff-policy/README.md rename to 04-errors-semantics/08-retry-backoff-policy/README.md diff --git a/19-defer-cleanup-chain/README.md b/04-errors-semantics/19-defer-cleanup-chain/README.md similarity index 100% rename from 19-defer-cleanup-chain/README.md rename to 04-errors-semantics/19-defer-cleanup-chain/README.md diff --git a/20-nil-interface-gotcha/README.md b/04-errors-semantics/20-nil-interface-gotcha/README.md similarity index 100% rename from 20-nil-interface-gotcha/README.md rename to 04-errors-semantics/20-nil-interface-gotcha/README.md diff --git a/13-iofs-config-loader/README.md b/05-filesystems-packaging/13-iofs-config-loader/README.md similarity index 100% rename from 13-iofs-config-loader/README.md rename to 05-filesystems-packaging/13-iofs-config-loader/README.md diff --git a/18-embedfs-dev-prod-switch/README.md b/05-filesystems-packaging/18-embedfs-dev-prod-switch/README.md similarity index 100% rename from 18-embedfs-dev-prod-switch/README.md rename to 05-filesystems-packaging/18-embedfs-dev-prod-switch/README.md diff --git a/15-testing-parallel-fuzz-harness/README.md b/06-testing-quality/15-testing-parallel-fuzz-harness/README.md similarity index 100% rename from 15-testing-parallel-fuzz-harness/README.md rename to 06-testing-quality/15-testing-parallel-fuzz-harness/README.md diff --git a/README.md b/README.md index 9406975..017d73f 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,58 @@ 4. **Optionally**, create a `main.go` or any other relevant files under the project containing blueprint of the implementation, **as long as you think it reduces confusion and keeps the implementation focused** 5. Submit a PR. -### Using the script +## Katas Index (Grouped) -You can use the shorthand script to add a new challenge, it will create a new folder and a new README.md file under it: -```bash -./add.sh my-very-creative-challange -``` -This will create a new folder `21-my-very-creative-challange` (in case the latest challange was under the folder name `20-latest-name-here`) and add a `README.md` under it +### 01) Context, Cancellation, and Fail-Fast Concurrency +Real-world concurrency patterns that prevent leaks, enforce backpressure, and fail fast under cancellation. -```bash -medunes@medunes:~/projects/go-kata$ ls 21-my-very-creative-challange/ -README.md -``` +- [01 - The Fail-Fast Data Aggregator](./01-context-cancellation-concurrency/01-concurrent-aggregator/) +- [03 - Graceful Shutdown Server](./01-context-cancellation-concurrency/03-graceful-shutdown-server/) +- [05 - Context-Aware Error Propagator](./01-context-cancellation-concurrency/05-context-aware-error-propagator/) +- [07 - The Rate-Limited Fan-Out Client](./01-context-cancellation-concurrency/07-rate-limited-fanout/) +- [09 - The Cache Stampede Shield (singleflight TTL)](./01-context-cancellation-concurrency/09-single-flight-ttl-cache/) +- [10 - Worker Pool with Backpressure and errors.Join](./01-context-cancellation-concurrency/10-worker-pool-errors-join/) +- [14 - The Leak-Free Scheduler](./01-context-cancellation-concurrency/14-leak-free-scheduler/) +- [17 - Context-Aware Channel Sender (No Leaked Producers)](./01-context-cancellation-concurrency/17-context-aware-channel-sender/) + +--- + +### 02) Performance, Allocation, and Throughput +Drills focused on memory efficiency, allocation control, and high-throughput data paths. + +- [02 - Concurrent Map with Sharded Locks](./02-performance-allocation/02-concurrent-map-with-sharded-locks/) +- [04 - Zero-Allocation JSON Parser](./02-performance-allocation/04-zero-allocation-json-parser/) +- [11 - NDJSON Stream Reader (Long Lines)](./02-performance-allocation/11-ndjson-stream-reader/) +- [12 - sync.Pool Buffer Middleware](./02-performance-allocation/12-sync-pool-buffer-middleware/) + +--- + +### 03) HTTP and Middleware Engineering +Idiomatic HTTP client/server patterns, middleware composition, and production hygiene. + +- [06 - Interface-Based Middleware Chain](./03-http-middleware/06-interface-based-middleware-chain/) +- [16 - HTTP Client Hygiene Wrapper](./03-http-middleware/16-http-client-hygiene/) + +--- + +### 04) Errors: Semantics, Wrapping, and Edge Cases +Modern Go error handling: retries, cleanup, wrapping, and infamous pitfalls. + +- [08 - Retry Policy That Respects Context](./04-errors-semantics/08-retry-backoff-policy/) +- [19 - The Cleanup Chain (defer + LIFO + Error Preservation)](./04-errors-semantics/19-defer-cleanup-chain/) +- [20 - The “nil != nil” Interface Trap (Typed nil Errors)](./04-errors-semantics/20-nil-interface-gotcha/) + +--- + +### 05) Filesystems, Packaging, and Deployment Ergonomics +Portable binaries, testable filesystem code, and dev/prod parity. + +- [13 - Filesystem-Agnostic Config Loader (io/fs)](./05-filesystems-packaging/13-iofs-config-loader/) +- [18 - embed.FS Dev/Prod Switch](./05-filesystems-packaging/18-embedfs-dev-prod-switch/) + +--- + +### 06) Testing and Quality Gates +Idiomatic Go testing: table-driven tests, parallelism, and fuzzing. + +- [15 - Go Test Harness (Subtests, Parallel, Fuzz)](./06-testing-quality/15-testing-parallel-fuzz-harness/)