Make PostgreSQL integration optional
Summary:
Some API microservices don't need a database, as they only compute data
or fetches it from other datasources.
As such, Cargo features are prepared to allow to create a build without
diesel/r2d2 integration.
In the same way, even if we compile againt those crates, it's valuable
to make the database an option at runtime too.
Finally, to offer minimal configuration and application is valuable too
to simplify the creation of a minimal microservice. That allows code like:
//! Docker Registry API application entry point use crate::requests::*; use limiting_factor::kernel::MinimalApplication; pub fn run () { let routes = routes![ status, favicon, getRegistyStats, getRepositoryInfo ]; MinimalApplication::start_application(routes); }
Fixes T1421.
Test Plan:
Test the code above with the following Cargo entry:
limiting-factor = { path = "../limiting-factor", features = ["minimal"] }
Compile the crate both in minimal and default features profiles.
Reviewers: dereckson
Reviewed By: dereckson
Maniphest Tasks: T1421
Differential Revision: https://devcentral.nasqueron.org/D1863