From 5a946ac869ddb93d1c29e9d899caa638a43adba7 Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Mon, 20 Jun 2022 21:24:01 -0300 Subject: [PATCH] fix: Accommodate partial features build (#333) --- Cargo.toml | 5 +++-- src/sinks/common/mod.rs | 2 ++ src/sinks/{common.rs => common/web.rs} | 0 src/sinks/gcp_cloudfunction/setup.rs | 2 +- src/sinks/gcp_pubsub/run.rs | 2 +- src/sinks/gcp_pubsub/setup.rs | 2 +- src/sinks/webhook/setup.rs | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 src/sinks/common/mod.rs rename src/sinks/{common.rs => common/web.rs} (100%) diff --git a/Cargo.toml b/Cargo.toml index 51e60000..e7f372b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,11 +64,12 @@ cloud-pubsub = { version = "0.8.0", optional = true } [features] default = [] +web = ["reqwest"] logs = ["file-rotate"] -webhook = ["reqwest"] +webhook = ["web"] kafkasink = ["kafka", "openssl"] elasticsink = ["elasticsearch", "tokio"] fingerprint = ["murmur3"] aws = ["aws-config", "aws-sdk-sqs", "aws-sdk-lambda", "aws-sdk-s3", "tokio"] redissink = ["redis", "tokio"] -gcp = ["cloud-pubsub", "tokio", "reqwest"] +gcp = ["cloud-pubsub", "tokio", "web"] diff --git a/src/sinks/common/mod.rs b/src/sinks/common/mod.rs new file mode 100644 index 00000000..b4b56de2 --- /dev/null +++ b/src/sinks/common/mod.rs @@ -0,0 +1,2 @@ +#[cfg(feature = "web")] +pub mod web; diff --git a/src/sinks/common.rs b/src/sinks/common/web.rs similarity index 100% rename from src/sinks/common.rs rename to src/sinks/common/web.rs diff --git a/src/sinks/gcp_cloudfunction/setup.rs b/src/sinks/gcp_cloudfunction/setup.rs index 0b224dfa..65e7c8c5 100644 --- a/src/sinks/gcp_cloudfunction/setup.rs +++ b/src/sinks/gcp_cloudfunction/setup.rs @@ -4,7 +4,7 @@ use serde::Deserialize; use crate::{ pipelining::{BootstrapResult, SinkProvider, StageReceiver}, - sinks::{build_headers_map, request_loop, ErrorPolicy, APP_USER_AGENT}, + sinks::common::web::{build_headers_map, request_loop, ErrorPolicy, APP_USER_AGENT}, utils::{retry, WithUtils}, }; diff --git a/src/sinks/gcp_pubsub/run.rs b/src/sinks/gcp_pubsub/run.rs index d7ccbfea..f3a82919 100644 --- a/src/sinks/gcp_pubsub/run.rs +++ b/src/sinks/gcp_pubsub/run.rs @@ -6,7 +6,7 @@ use serde_json::json; use crate::{ model::Event, pipelining::StageReceiver, - sinks::ErrorPolicy, + sinks::common::web::ErrorPolicy, utils::{retry, Utils}, }; diff --git a/src/sinks/gcp_pubsub/setup.rs b/src/sinks/gcp_pubsub/setup.rs index bcc17000..43653367 100644 --- a/src/sinks/gcp_pubsub/setup.rs +++ b/src/sinks/gcp_pubsub/setup.rs @@ -2,7 +2,7 @@ use serde::Deserialize; use crate::{ pipelining::{BootstrapResult, SinkProvider, StageReceiver}, - sinks::ErrorPolicy, + sinks::common::web::ErrorPolicy, utils::{retry, WithUtils}, }; diff --git a/src/sinks/webhook/setup.rs b/src/sinks/webhook/setup.rs index e0fa40c5..9e8ab0f3 100644 --- a/src/sinks/webhook/setup.rs +++ b/src/sinks/webhook/setup.rs @@ -4,7 +4,7 @@ use serde::Deserialize; use crate::{ pipelining::{BootstrapResult, SinkProvider, StageReceiver}, - sinks::{build_headers_map, request_loop, ErrorPolicy, APP_USER_AGENT}, + sinks::common::web::{build_headers_map, request_loop, ErrorPolicy, APP_USER_AGENT}, utils::{retry, WithUtils}, };