Skip to content

Commit

Permalink
Bridge(kafka): guard kafka-related symbols with cfg attrs
Browse files Browse the repository at this point in the history
Adds a few more `cfg` attributes to hide kafka-related things at compile
time when needed.
  • Loading branch information
svix-onelson authored and svix-james committed Nov 8, 2024
1 parent f9c5212 commit f9b6c1c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bridge/svix-bridge/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ pub enum ReceiverOutputOpts {
impl WebhookReceiverConfig {
pub async fn into_receiver_output(self) -> anyhow::Result<Box<dyn ReceiverOutput>> {
match self.output {
#[cfg(feature = "kafka")]
ReceiverOutputOpts::Kafka(opts) => {
svix_bridge_plugin_kafka::into_receiver_output(self.name, opts).map_err(Into::into)
}
Expand Down Expand Up @@ -313,6 +314,7 @@ impl PollerReceiverConfig {
// FIXME: duplicate from WebhookReceiverConfig. Extract/refactor as TryFrom ReceiverOutputOpts?
pub async fn into_receiver_output(self) -> anyhow::Result<Box<dyn ReceiverOutput>> {
match self.output {
#[cfg(feature = "kafka")]
ReceiverOutputOpts::Kafka(opts) => {
svix_bridge_plugin_kafka::into_receiver_output(self.name, opts).map_err(Into::into)
}
Expand Down

0 comments on commit f9b6c1c

Please sign in to comment.