Promote service modules to services/ directory; add AmqpConnection + async IPL
- Flat src/amqp.rs, src/mongo.rs, src/mariadb.rs promoted to src/services/{amqp,mongo,mariadb}/
- services/amqp/connection.rs: AmqpConnection struct with connect() and declare_exchange()
- services/amqp/error.rs: AmqpError type (thiserror, wraps lapin::Error)
- ipl() made async; #[tokio::main] added to main()
- IPL step 3b: authenticate to RabbitMQ + declare beds.events topic exchange (durable)
- Added lapin = "2" and tokio = { version = "1", features = ["full"] } to Cargo.toml
- 12 unit tests pass
- Docs: README, CLAUDE.md, wiki/04-ipl.md, wiki/06-queue-topology.md updated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
44
README.md
44
README.md
@@ -85,26 +85,33 @@ Every node runs the same binary. Configuration determines what it does.
|
||||
rustybeds/
|
||||
├── src/
|
||||
│ ├── config/
|
||||
│ │ ├── mod.rs # Loader — load() and load_from() for testability
|
||||
│ │ └── structs.rs # Typed config structs (serde Deserialize)
|
||||
│ ├── amqp.rs # RabbitMQ transport — validate(), future channel/queue ops
|
||||
│ ├── mariadb.rs # MariaDB transport — validate_all(), future adapter ops
|
||||
│ ├── mongo.rs # MongoDB transport — validate_all(), future adapter ops
|
||||
│ ├── lib.rs # Public API surface for integration test harness
|
||||
│ ├── logging.rs # tracing + journald init
|
||||
│ └── main.rs # ipl() sequence + main()
|
||||
│ │ ├── mod.rs # Loader — load() and load_from() for testability
|
||||
│ │ └── structs.rs # Typed config structs (serde Deserialize)
|
||||
│ ├── services/
|
||||
│ │ ├── mod.rs # Groups external service transport modules
|
||||
│ │ ├── amqp/
|
||||
│ │ │ ├── mod.rs # validate() — TCP reachability pre-flight
|
||||
│ │ │ ├── connection.rs # AmqpConnection — auth + exchange declare
|
||||
│ │ │ └── error.rs # AmqpError type
|
||||
│ │ ├── mongo/
|
||||
│ │ │ └── mod.rs # validate_all() — TCP reachability
|
||||
│ │ └── mariadb/
|
||||
│ │ └── mod.rs # validate_all() — master/secondary pattern
|
||||
│ ├── lib.rs # Public API surface for integration test harness
|
||||
│ ├── logging.rs # tracing + journald init
|
||||
│ └── main.rs # async ipl() sequence + #[tokio::main] main()
|
||||
├── config/
|
||||
│ ├── beds.toml # Base config — checked in, no credentials
|
||||
│ ├── env_dev.toml # Dev overrides — gitignored
|
||||
│ ├── env_qa.toml # QA overrides — gitignored
|
||||
│ └── env_prod.toml # Prod overrides — gitignored
|
||||
│ ├── beds.toml # Base config — checked in, no credentials
|
||||
│ ├── env_dev.toml # Dev overrides — gitignored
|
||||
│ ├── env_qa.toml # QA overrides — gitignored
|
||||
│ └── env_prod.toml # Prod overrides — gitignored
|
||||
├── templates/
|
||||
│ ├── example_rec.toml # Canonical self-documenting REC template
|
||||
│ └── mst_logger_rec.toml # Logger collection template (msLogs)
|
||||
│ ├── example_rec.toml # Canonical self-documenting REC template
|
||||
│ └── mst_logger_rec.toml # Logger collection template (msLogs)
|
||||
├── tests/
|
||||
│ ├── common/mod.rs # Shared test helpers — load_test_config()
|
||||
│ ├── common/mod.rs # Shared test helpers — load_test_config()
|
||||
│ └── fixtures/
|
||||
│ └── beds_test.toml # Canonical test config fixture
|
||||
│ └── beds_test.toml # Canonical test config fixture
|
||||
└── Cargo.toml
|
||||
```
|
||||
|
||||
@@ -138,11 +145,12 @@ The `config` crate deep-merges these at startup. Only keys present in the env fi
|
||||
| Structured logging (journald + console mirror) | Done |
|
||||
| IPL sequence with env-aware error handling | Done |
|
||||
| RabbitMQ reachability validation | Done |
|
||||
| RabbitMQ authentication + exchange declaration | Done |
|
||||
| Unit test scaffolding + config fixture pattern | Done |
|
||||
| MongoDB reachability validation | Done |
|
||||
| MariaDB reachability validation | Done |
|
||||
| Shared filesystem validation | Next |
|
||||
| AMQP channel / queue declaration | Planned |
|
||||
| Broker pool (Tokio tasks) + queue declaration | Next |
|
||||
| AMQP publish / consume | Planned |
|
||||
| Broker pool (Tokio tasks) | Planned |
|
||||
| NamasteCore trait | Planned |
|
||||
| Database adapters (MariaDB, MongoDB) | Planned |
|
||||
|
||||
Reference in New Issue
Block a user