opsqueue/lib.rs
1//! Opsqueue: A lightweight batch processing queue for heavy loads
2//!
3//! Simple 'getting started' instructions can be found [in the repository README](https://github.com/channable/opsqueue/).
4//!
5//! The Rust codebase defines both the 'server', which makes up the bulk of the Opsqueue binary itself,
6//! and the 'client', which is the common part of functionality that clients written in different other programming languages
7//! can all use.
8//!
9//! Many datatypes are shared between this server and client, and therefore their code lives together in the same crate.
10//! Instead, we use feature-flags (`client-logic` and `server-logic`) to decide what concrete parts to include when building.
11//! The set of dependencies is based on these same feature-flags.
12//! Most interestingly, in the test suite we enable both feature-flags so we're able to do a bunch of round-trip testing
13//! immediately in Rust code.
14//!
15//! # Module setup
16//! - The basic logic is divided in the `producer` and `consumer` modules. These both have their own `db` submodule.
17//! - Common functionality and datatypes exists in the `common` module
18//! - Common database helpers live in the `db` module.
19//! - Reading/writing to object stores like GCS or S3 is abstracted in the `object_store` module.
20//! - Finally, extra modules to have a single source of truth for configuration of the queue, and to nicely do tracing and expose metrics exist.
21
22pub mod common;
23pub mod consumer;
24pub mod producer;
25pub mod tracing;
26
27#[cfg(feature = "client-logic")]
28pub mod object_store;
29
30#[cfg(feature = "server-logic")]
31pub mod db;
32
33#[cfg(feature = "server-logic")]
34pub mod server;
35
36#[cfg(feature = "server-logic")]
37pub mod prometheus;
38
39#[cfg(feature = "server-logic")]
40pub mod config;
41
42/// The Opsqueue library's semantic version
43/// as written in the Rust packages's `Cargo.toml`
44pub const VERSION_CARGO_SEMVER: &str = env!("CARGO_PKG_VERSION");
45
46#[allow(clippy::const_is_empty)]
47pub fn version_info() -> String {
48 format!("v{VERSION_CARGO_SEMVER}")
49}