Skip to main content

Crate rightsize_modules

Crate rightsize_modules 

Source
Expand description

rightsize-modules ships eighteen preconfigured containers on top of the rightsize core: Redis, Memcached, ArangoDB, MongoDB, Redpanda, Kafka, SpringCloudConfig, PostgreSQL, MySQL, Apache Pinot, RabbitMQ, MariaDB, WireMock, ClickHouse, Keycloak, Neo4j, Floci, and Apache Flink. Each module is a thin newtype wrapping rightsize’s Container builder — no subclassing, just the spec-customizer and post-start hooks the core exposes — with connection helpers on its guard.

Backend wiring is a Cargo feature choice, not a runtime one: backend-msb and backend-docker (both on by default) pull in rightsize-msb and rightsize-docker respectively so consumers can trim the dependency they don’t need. The feature-enabled backends register themselves the first time any module starts — no register_provider boilerplate; see register_default_backends for the one case where calling it yourself is still useful.

Re-exports§

pub use arango::ArangoContainer;
pub use arango::ArangoGuard;
pub use clickhouse::ClickHouseContainer;
pub use clickhouse::ClickHouseGuard;
pub use flink::FlinkGuard;
pub use floci::FlociContainer;
pub use floci::FlociGuard;
pub use kafka::KafkaContainer;
pub use kafka::KafkaGuard;
pub use keycloak::KeycloakContainer;
pub use keycloak::KeycloakGuard;
pub use mariadb::MariaDbContainer;
pub use mariadb::MariaDbGuard;
pub use memcached::MemcachedContainer;
pub use memcached::MemcachedGuard;
pub use mongodb::MongoDbContainer;
pub use mongodb::MongoDbGuard;
pub use mysql::MySqlContainer;
pub use mysql::MySqlGuard;
pub use neo4j::Neo4jContainer;
pub use neo4j::Neo4jGuard;
pub use pinot::PinotContainer;
pub use pinot::PinotGuard;
pub use postgres::PostgresContainer;
pub use postgres::PostgresGuard;
pub use rabbitmq::RabbitMqContainer;
pub use rabbitmq::RabbitMqGuard;
pub use redis::RedisContainer;
pub use redis::RedisGuard;
pub use redpanda::RedpandaContainer;
pub use redpanda::RedpandaGuard;
pub use spring_cloud_config::SpringCloudConfigContainer;
pub use spring_cloud_config::SpringCloudConfigGuard;
pub use wiremock::WireMockContainer;
pub use wiremock::WireMockGuard;

Modules§

arango
A single-node ArangoDB container. Auth is disabled by default; see ArangoContainer::with_root_password to enable it.
clickhouse
A single-node ClickHouse container, queried over its HTTP interface (port 8123). The native protocol port (9000) is exposed too, but this module’s helpers are HTTP-first: the HTTP interface needs no client dependency (ureq as a dev-dep, no runtime crate), matching the house convention for HTTP-first modules.
flink
An Apache Flink JobManager, optionally paired with a companion TaskManager via FlinkContainer::with_task_manager for a real session cluster that can actually run jobs (a bare JobManager has zero task slots and can only accept/reject submissions, never execute them).
floci
A floci.io cloud emulator — one native Quarkus image per cloud provider, each speaking that provider’s REST APIs against an in-memory backing store. One module type covers all three variants; pick one with the FlociContainer::aws/FlociContainer::azure/FlociContainer::gcp factory functions rather than a bare constructor — each factory pins the provider’s own image and guest port.
kafka
A single-node Kafka broker (KRaft mode, no ZooKeeper).
keycloak
A single-node Keycloak container in start-dev mode (in-memory H2, no external database — fine for tests, never for production).
mariadb
A single-node MariaDB container. Defaults to a test/test/test user/password/database trio (plus MARIADB_ROOT_PASSWORD=test) so MariaDbGuard::connection_string is usable with zero configuration; call MariaDbContainer::with_username/MariaDbContainer::with_password/ MariaDbContainer::with_database before start() to override any of them.
memcached
A single-node Memcached container, ready-checked with a protocol-level version probe instead of the bare listening-port wait.
mongodb
A single-node MongoDB container running as a one-member replica set (required for transactions/change streams). The Container::with_post_start hook initiates the replica set and waits for a primary to be elected before start() returns, so MongoDbGuard::connection_string is always usable immediately after start().
mysql
A single-node MySQL container. Defaults to a test/test/test user/password/database trio (plus MYSQL_ROOT_PASSWORD=test) so MySqlGuard::connection_string is usable with zero configuration; call MySqlContainer::with_username/MySqlContainer::with_password/ MySqlContainer::with_database before start() to override any of them.
neo4j
A single-node Neo4j Community container, queried over its HTTP Cypher transaction endpoint (/db/neo4j/tx/commit) — no bolt driver dependency needed, matching the house convention for HTTP-first modules (crate::clickhouse::ClickHouseContainer, crate::pinot::PinotContainer). The bolt port (7687) is still exposed and its URI available via Neo4jGuard::bolt_url for callers who do want a real driver.
pinot
A single-container Apache Pinot “QuickStart” cluster: controller, broker, server, minion, and an embedded ZooKeeper, all as one process tree inside one image, started with QuickStart -type EMPTY (a clean cluster with no demo tables — this module is a real-cluster smoke fixture, not a data-loading harness).
postgres
A single-node PostgreSQL container. Defaults to a test/test/test user/password/database trio so PostgresGuard::connection_string is usable with zero configuration; call PostgresContainer::with_username/ PostgresContainer::with_password/PostgresContainer::with_database before start() to override any of them.
rabbitmq
A single-node RabbitMQ container with the management plugin enabled. Defaults to a guest/guest credential pair (the image’s own default) so RabbitMqGuard::amqp_url is usable with zero configuration; call RabbitMqContainer::with_username/RabbitMqContainer::with_password before start() to override either.
redis
A single-node Redis container.
redpanda
A single-node Redpanda broker (Kafka API-compatible) with its schema registry enabled.
spring_cloud_config
A Spring Cloud Config Server container, ready-checked via its actuator health endpoint.
wiremock
A WireMock server container for stubbing HTTP dependencies in integration tests.

Functions§

register_default_backends
Registers the feature-enabled backend providers (backend-msb, backend-docker) with rightsize::backends. Runs its body once per process, and the core registry is itself idempotent by provider name, so calling this again — or also registering a provider by hand — is harmless.