move signal-gateway binary to its own crate, simplify deps

This commit is contained in:
Chris Beck
2025-12-05 01:01:39 -07:00
parent ae26faa045
commit 3d748572d4
6 changed files with 48 additions and 21 deletions
Generated
+16 -5
View File
@@ -1645,20 +1645,16 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
name = "signal-gateway"
version = "0.1.0"
dependencies = [
"bytes",
"chrono",
"chrono-tz",
"conf",
"conf-extra",
"displaydoc",
"dotenvy",
"futures-util",
"http",
"http-body",
"http-body-util",
"humantime",
"hyper",
"hyper-util",
"jsonrpsee",
"prometheus-http-client",
"rand",
@@ -1669,11 +1665,26 @@ dependencies = [
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
"url",
"walkdir",
]
[[package]]
name = "signal-gateway-bin"
version = "0.1.0"
dependencies = [
"conf",
"dotenvy",
"hyper",
"hyper-util",
"signal-gateway",
"syslog_rfc5424",
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.7"
+2 -2
View File
@@ -3,6 +3,7 @@ resolver = "2"
members = [
"prometheus-http-client",
"signal-gateway",
"signal-gateway-bin",
]
[workspace.package]
@@ -24,7 +25,6 @@ result_large_err = "allow"
prometheus-http-client = { path = "prometheus-http-client", default-features = false }
async-trait = "0.1"
bytes = "1"
chrono = { version = "0.4", default-features = false, features = ["clock", "serde", "std"] }
chrono-tz = "0.10"
conf = "0.4"
@@ -46,7 +46,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
syslog_rfc5424 = "0.10"
thiserror = "2"
tokio = { version = "1", features = ["io-util", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] }
tokio = { version = "1", features = ["io-util", "macros", "net", "sync", "time"] }
tokio-util = { version = "0.7", features = ["codec"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
+29
View File
@@ -0,0 +1,29 @@
[package]
name = "signal-gateway-bin"
version = "0.1.0"
edition.workspace = true
[lints]
workspace = true
[[bin]]
name = "signal-gateway"
path = "src/main.rs"
[features]
default = ["signal-gateway/default"]
plot = ["signal-gateway/plot"]
rustls-tls = ["signal-gateway/rustls-tls"]
[dependencies]
signal-gateway = { path = "../signal-gateway" }
conf = { workspace = true }
dotenvy = { workspace = true }
hyper = { workspace = true }
hyper-util = { workspace = true }
syslog_rfc5424 = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "signal"] }
tokio-util = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
-13
View File
@@ -10,17 +10,10 @@ workspace = true
default = ["plot"]
plot = ["prometheus-http-client/plot", "dep:chrono-tz", "dep:rand", "dep:walkdir"]
rustls-tls = ["prometheus-http-client/rustls-tls"]
bin = ["dep:dotenvy", "dep:hyper", "dep:hyper-util", "dep:tracing-subscriber"]
[[bin]]
name = "signal-gateway"
path = "src/bin/main.rs"
required-features = ["bin"]
[dependencies]
prometheus-http-client = { workspace = true, default-features = false }
bytes = { workspace = true }
chrono = { workspace = true }
conf = { workspace = true }
conf-extra = { workspace = true }
@@ -40,12 +33,6 @@ tokio-util = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }
# Optional dependencies for bin feature
dotenvy = { workspace = true, optional = true }
hyper = { workspace = true, optional = true }
hyper-util = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
# Optional dependencies for plot feature
chrono-tz = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
+1 -1
View File
@@ -3,7 +3,7 @@ use crate::{
jsonrpc::{Envelope, RpcClient, RpcClientError, SignalMessage, connect_tcp},
prometheus::{Prometheus, PrometheusConfig},
};
use bytes::Buf;
use tokio_util::bytes::Buf;
use conf::{Conf, Subcommands};
use futures_util::FutureExt;
pub use http::{Method, Request, Response, StatusCode};