Skip to content

Commit 589db8e

Browse files
Renamed features (#140)
* Renamed features Moved all bindings under a binding crate Signed-off-by: Francesco Guardiani <[email protected]> * Cargo fmt Signed-off-by: Francesco Guardiani <[email protected]> * Now this should build Signed-off-by: Francesco Guardiani <[email protected]> * Use the new cache plugin Signed-off-by: Francesco Guardiani <[email protected]> * Fix Signed-off-by: Francesco Guardiani <[email protected]> * Fix the build Signed-off-by: Francesco Guardiani <[email protected]> * Fixed doc links Signed-off-by: Francesco Guardiani <[email protected]> * Change link Signed-off-by: Francesco Guardiani <[email protected]>
1 parent cd98c67 commit 589db8e

File tree

31 files changed

+165
-133
lines changed

31 files changed

+165
-133
lines changed

.github/workflows/rust_tests.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,19 @@ jobs:
3232
if: matrix.target == 'x86_64-unknown-linux-musl'
3333

3434
# Caching stuff
35-
- name: Cache cargo registry
36-
uses: actions/cache@v1
35+
- uses: actions/cache@v2
3736
with:
38-
path: ~/.cargo/registry
39-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
40-
- name: Cache cargo index
41-
uses: actions/cache@v1
37+
path: |
38+
~/.cargo/bin/
39+
~/.cargo/registry/index/
40+
~/.cargo/registry/cache/
41+
~/.cargo/git/db/
42+
key: ${{ runner.os }}-cargo-deps-${{ hashFiles('**/Cargo.toml') }}
43+
- uses: actions/cache@v2
4244
with:
43-
path: ~/.cargo/git
44-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
45-
- name: Cache cargo build
46-
uses: actions/cache@v1
47-
with:
48-
path: target
49-
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
45+
path: |
46+
target/
47+
key: ${{ runner.os }}-cargo-target-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
5048
- uses: actions-rs/toolchain@v1
5149
with:
5250
toolchain: ${{ matrix.toolchain }}
@@ -97,7 +95,7 @@ jobs:
9795
with:
9896
command: build
9997
toolchain: ${{ matrix.toolchain }}
100-
args: --target wasm32-unknown-unknown --features cloudevents-reqwest
98+
args: --target wasm32-unknown-unknown --features reqwest
10199

102100
# Build examples
103101
- uses: actions-rs/cargo@v1

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ categories = ["web-programming", "encoding", "data-structures"]
1717
name = "cloudevents"
1818

1919
[features]
20-
cloudevents-actix = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
21-
cloudevents-reqwest = ["reqwest", "async-trait", "lazy_static", "bytes"]
22-
cloudevents-rdkafka = ["rdkafka", "lazy_static", "bytes"]
23-
cloudevents-warp = ["warp", "lazy_static", "bytes", "http", "hyper"]
20+
actix = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
21+
reqwest = ["reqwest-lib", "async-trait", "lazy_static", "bytes"]
22+
rdkafka = ["rdkafka-lib", "lazy_static", "bytes", "futures"]
23+
warp = ["warp-lib", "lazy_static", "bytes", "http", "hyper"]
2424

2525
[dependencies]
2626
serde = { version = "^1.0", features = ["derive"] }
@@ -34,9 +34,9 @@ bitflags = "^1.2"
3434

3535
# runtime optional deps
3636
actix-web = { version = "^3", default-features = false, optional = true }
37-
reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true }
38-
rdkafka = { version = "^0.25", features = ["cmake-build"], optional = true }
39-
warp = { version = "^0.3", optional = true }
37+
reqwest-lib = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true, package = "reqwest" }
38+
rdkafka-lib = { version = "^0.25", features = ["cmake-build"], optional = true, package = "rdkafka" }
39+
warp-lib = { version = "^0.3", optional = true, package = "warp" }
4040
async-trait = { version = "^0.1.33", optional = true }
4141
lazy_static = { version = "1.4.0", optional = true }
4242
bytes = { version = "^1.0", optional = true }

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ The core modules include definitions for the `Event` and
2525
mechanism to support various Protocol Bindings, each of which is
2626
enabled by a specific [feature flag]:
2727

28-
* `cloudevents-actix`: Integration with [actix](https://actix.rs/).
29-
* `cloudevents-warp`: Integration with [warp](https://github.com/seanmonstar/warp/).
30-
* `cloudevents-reqwest`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
31-
* `cloudevents-rdkafka`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
28+
* `actix`: Integration with [actix](https://actix.rs/).
29+
* `warp`: Integration with [warp](https://github.com/seanmonstar/warp/).
30+
* `reqwest`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
31+
* `rdkafka`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
3232

3333
This crate is continuously tested to work with GNU libc, WASM and musl
3434
toolchains.
@@ -40,7 +40,7 @@ enabling your Protocol Binding of choice:
4040

4141
```toml
4242
[dependencies]
43-
cloudevents-sdk = { version = "0.3.1", features = ["cloudevents-actix"] }
43+
cloudevents-sdk = { version = "0.3.1", features = ["actix"] }
4444
```
4545

4646
Now you can start creating events:

example-projects/actix-web-example/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ authors = ["Francesco Guardiani <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
cloudevents-sdk = { path = "../..", features = ["cloudevents-actix"] }
8+
cloudevents-sdk = { path = "../..", features = ["actix"] }
99
actix-web = "^3"
1010
actix-cors = "^0.5"
11-
lazy_static = "1.4.0"
12-
bytes = "^0.5"
13-
futures = "^0.3"
1411
serde_json = "^1.0"
1512
url = { version = "^2.1" }
1613
env_logger = "0.7.1"

example-projects/rdkafka-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88

99
[dependencies]
1010
async-trait = "^0.1.33"
11-
cloudevents-sdk = { path = "../..", features = ["cloudevents-rdkafka"] }
11+
cloudevents-sdk = { path = "../..", features = ["rdkafka"] }
1212
lazy_static = "1.4.0"
1313
bytes = "^1.0"
1414
url = { version = "^2.1", features = ["serde"] }

example-projects/rdkafka-example/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use futures::StreamExt;
33
use serde_json::json;
44

55
use cloudevents::{EventBuilder, EventBuilderV10};
6-
use cloudevents::rdkafka::{FutureRecordExt, MessageExt, MessageRecord};
6+
use cloudevents::binding::rdkafka::{FutureRecordExt, MessageExt, MessageRecord};
77

88
use rdkafka::config::{ClientConfig, RDKafkaLogLevel};
99
use rdkafka::consumer::stream_consumer::StreamConsumer;

example-projects/reqwest-wasm-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
reqwest = "^0.11"
14-
cloudevents-sdk = { path = "../..", features = ["cloudevents-reqwest"] }
14+
cloudevents-sdk = { path = "../..", features = ["reqwest"] }
1515
url = { version = "^2.1" }
1616
web-sys = { version = "0.3.39", features = ["Window", "Location"] }
1717
wasm-bindgen-futures = "0.4.12"

example-projects/reqwest-wasm-example/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use cloudevents::reqwest::RequestBuilderExt;
1+
use cloudevents::binding::reqwest::RequestBuilderExt;
22
use cloudevents::{EventBuilder, EventBuilderV10};
33
use wasm_bindgen::prelude::*;
44

example-projects/warp-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ categories = ["web-programming", "encoding"]
77
license-file = "../LICENSE"
88

99
[dependencies]
10-
cloudevents-sdk = { path = "../..", features = ["cloudevents-warp"] }
10+
cloudevents-sdk = { path = "../..", features = ["warp"] }
1111
warp = "^0.3"
1212
tokio = { version = "^1.0", features = ["full"] }

example-projects/warp-example/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use cloudevents::warp::{filter, reply};
1+
use cloudevents::binding::warp::{filter, reply};
22
use warp::Filter;
33

44
#[tokio::main]

0 commit comments

Comments
 (0)