Skip to content

Commit

Permalink
Split transform into seperate crate
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Mar 9, 2023
1 parent 63f6e8e commit 1460d08
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
18 changes: 14 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"test-helpers",
"tokio-bin-process",
"custom-transforms-example",
"redis-get-rewrite"
]

# https://deterministic.space/high-performance-rust.html
Expand Down
7 changes: 2 additions & 5 deletions custom-transforms-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ license = "Apache-2.0"
shotover-proxy = { path = "../shotover-proxy" }
anyhow = "1.0"
clap = "4.0.4"
serde = "1.0"
async-trait = "0.1.30"
tracing = "0.1"
typetag = "0.2.6"
redis-get-rewrite = { path = "../redis-get-rewrite" }

[dev-dependencies]
tokio = "1.25.0"
test-helpers = {path = "../test-helpers"}
test-helpers = { path = "../test-helpers"}
redis = "0.22.0"
8 changes: 5 additions & 3 deletions custom-transforms-example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use anyhow::Result;
use clap::Parser;

// We need to import this to get the typetag to register.
// TODO: I suspect hiding it behind a `shotover_proxy::import_transform!(redis_get_rewrite::RedisGetRewriteConfig)` would look nicer.
// We could also have the macro check that it implements the TransformConfig trait
#[allow(unused_imports)]
use redis_get_rewrite::RedisGetRewriteConfig;
use shotover_proxy::runner::{ConfigOpts, Runner};

mod redis_get_rewrite;

fn main() -> Result<()> {
Runner::new(ConfigOpts::parse())?
.with_observability_interface()?
Expand Down
17 changes: 17 additions & 0 deletions redis-get-rewrite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "redis-get-rewrite"
version = "0.0.1"
authors = ["Ben <ben@instaclustr.com>"]
edition = "2021"
license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
shotover-proxy = { path = "../shotover-proxy" }
anyhow = "1.0"
clap = "4.0.4"
serde = "1.0"
async-trait = "0.1.30"
tracing = "0.1"
typetag = "0.2.6"
File renamed without changes.

0 comments on commit 1460d08

Please sign in to comment.