diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index cab3ebd..17e7beb 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -49,7 +49,7 @@ jobs: timeout-minutes: 40 with: command: test - args: --all -- --test-threads 1 --nocapture + args: --all --features sink_elastic -- --test-threads 1 --nocapture - name: Check build uses: actions-rs/cargo@v1 @@ -57,8 +57,18 @@ jobs: with: command: build - - name: Build Docs - uses: actions-rs/cargo@v1 + check_docs: + name: docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - uses: actions-rs/toolchain@v1 with: - command: doc - args: --features docs \ No newline at end of file + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - name: Docs + run: cargo doc --features docs \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 2dc204f..1becff9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,8 +35,8 @@ exclude = [ [features] default = ["epoll", "asyncexec"] docs = [ - "store-rocksdb", - "sink-elastic" + "store_rocksdb", + "sink_elastic" ] # IO systems iouring = ["nuclei/iouring"] @@ -47,9 +47,9 @@ tokio = ["nuclei/tokio"] tokio03 = ["nuclei/tokio03"] tokio02 = ["nuclei/tokio02"] # Storage systems -store-rocksdb = ["rocksdb"] +store_rocksdb = ["rocksdb"] # Sinks -sink-elastic = [ +sink_elastic = [ "tokio", "elasticsearch" ] @@ -61,7 +61,7 @@ lightproc = "0.3.5" lever = "0.1.3" thiserror = "1.0" async-trait = "0.1" -futures = "0.3" +futures = { version = "0.3", default-features = false, features = ["std", "async-await"] } futures-timer = "3.0" crossbeam-channel = "0.5" rdkafka = { version = "0.28.0", default-features = false, features = ["libz"]} diff --git a/src/errors.rs b/src/errors.rs index a49ef4f..4af952e 100755 --- a/src/errors.rs +++ b/src/errors.rs @@ -33,11 +33,11 @@ pub enum CallystoError { #[error("UTF-8 Conversion error: {0}")] UTF8ConversionError(#[from] Utf8Error), - #[cfg(feature = "store-rocksdb")] + #[cfg(feature = "store_rocksdb")] #[error("RocksDB Error")] RocksDBError(#[from] rocksdb::Error), - #[cfg(feature = "sink-elastic")] + #[cfg(feature = "sink_elastic")] #[error("ElasticSearch Error")] ElasticSearchError(#[from] elasticsearch::Error), } diff --git a/src/lib.rs b/src/lib.rs index 02170f3..e11068a 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,10 +57,10 @@ mod stores; pub use futures; /// Reexport of http_types pub use http_types; -/// Reexport of rdkafka -pub use rdkafka; /// Reexport of nuclei pub use nuclei; +/// Reexport of rdkafka +pub use rdkafka; /// Callysto prelude pub mod prelude { diff --git a/src/sinks/mod.rs b/src/sinks/mod.rs index a0aaf87..ca456be 100644 --- a/src/sinks/mod.rs +++ b/src/sinks/mod.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "sink-elastic")] +#[cfg(feature = "sink_elastic")] #[cfg_attr(feature = "docs", doc(cfg(sink_elastic)))] /// ElasticSearch Sink for CStream pub mod elasticsearch; diff --git a/src/stores/mod.rs b/src/stores/mod.rs index 90573f3..9905589 100755 --- a/src/stores/mod.rs +++ b/src/stores/mod.rs @@ -1,4 +1,5 @@ pub(crate) mod inmemory; -#[cfg(feature = "store-rocksdb")] +#[cfg(feature = "store_rocksdb")] +#[cfg_attr(feature = "docs", doc(cfg(store_rocksdb)))] pub(crate) mod rocksdb; pub(crate) mod store; diff --git a/src/stores/rocksdb.rs b/src/stores/rocksdb.rs index 684dd3d..8eb6eec 100755 --- a/src/stores/rocksdb.rs +++ b/src/stores/rocksdb.rs @@ -485,7 +485,7 @@ where todo!() } - fn into_service(self) -> Arc> { - Arc::new(self) + fn into_service(&self) -> &dyn Service { + self } } diff --git a/src/types/table.rs b/src/types/table.rs index 73b0063..218292b 100755 --- a/src/types/table.rs +++ b/src/types/table.rs @@ -129,7 +129,7 @@ where Ok(Arc::new(db)) } "rocksdb" | "rocks" => { - #[cfg(feature = "store-rocksdb")] + #[cfg(feature = "store_rocksdb")] { use crate::stores::rocksdb::RocksDbStore; let rdb = RocksDbStore::new(app_name, storage_url, table_name); @@ -137,7 +137,7 @@ where } Err(CallystoError::GeneralError( - "RocksDB feature is not enabled. `store-rocksdb` is the feature name.".into(), + "RocksDB feature is not enabled. `store_rocksdb` is the feature name.".into(), )) } "aerospikedb" | "aerospike" => todo!(),