Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ autoexamples = true
all-features = true

[features]
default = ["with_client_implementation", "with_panic", "with_failure", "with_log", "with_env_logger", "with_device_info", "with_rust_info"]
with_client_implementation = ["reqwest", "im", "url", "with_backtrace"]
default = ["with_client_implementation", "with_default_transport", "with_panic", "with_failure", "with_log", "with_env_logger", "with_device_info", "with_rust_info"]
with_reqwest_transport = ["reqwest", "httpdate", "with_client_implementation"]
with_curl_transport = ["curl", "httpdate", "serde_json", "with_client_implementation"]
with_default_transport = ["with_reqwest_transport"]
with_client_implementation = ["im", "url", "with_backtrace"]
with_backtrace = ["backtrace", "regex"]
with_panic = ["with_backtrace"]
with_failure = ["failure", "with_backtrace"]
Expand Down Expand Up @@ -48,7 +51,9 @@ libc = { version = "0.2.48", optional = true }
hostname = { version = "0.1.5", optional = true }
findshlibs = { version = "0.4.1", optional = true }
rand = "0.6.5"
httpdate = "0.3.2"
httpdate = { version = "0.3.2", optional = true }
curl = { version = "0.4.19", optional = true }
serde_json = { version = "1.0.38", optional = true }

[target."cfg(not(windows))".dependencies]
uname = { version = "0.1.1", optional = true }
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ check-all-impls:
@RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_failure,with_log,with_panic,with_error_chain'
.PHONY: check-all-impls

check-curl-transport:
@echo 'CURL TRANSPORT'
@RUSTFLAGS=-Dwarnings cargo check --features with_curl_transport
@echo 'CURL TRANSPORT ONLY'
@RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_curl_transport,with_client_implementation,with_panic'
.PHONY: check-curl-transport

check-actix:
@echo 'ACTIX INTEGRATION'
@RUSTFLAGS=-Dwarnings cargo check --manifest-path integrations/sentry-actix/Cargo.toml
Expand All @@ -61,7 +68,7 @@ check-actix:
check: check-no-default-features check-default-features
.PHONY: check-all-features

checkall: check-all-features check-no-default-features check-default-features check-failure check-log check-panic check-error-chain check-all-impls check-actix
checkall: check-all-features check-no-default-features check-default-features check-failure check-log check-panic check-error-chain check-all-impls check-curl-transport check-actix
.PHONY: checkall

cargotest:
Expand Down
22 changes: 21 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
//! default flags:
//!
//! * `with_client_implementation`: turns on the real client implementation.
//! * `with_default_transport`: compiles in the default HTTP transport.
//! * `with_backtrace`: enables backtrace support (automatically turned on in a few cases)
//! * `with_panic`: enables the panic integration
//! * `with_failure`: enables the `failure` integration
Expand All @@ -104,6 +105,9 @@
//!
//! * `with_error_chain`: enables the error-chain integration
//! * `with_test_support`: enables the test support module
//! * `with_reqwest_transport`: enables the reqwest transport explicitly. This
//! is currently the default transport.
//! * `with_curl_transport`: enables the curl transport.
#![warn(missing_docs)]

#[macro_use]
Expand Down Expand Up @@ -142,7 +146,7 @@ pub mod internals {
#[cfg(feature = "with_client_implementation")]
pub use crate::{
client::{ClientInitGuard, IntoDsn},
transport::{DefaultTransportFactory, HttpTransport, Transport, TransportFactory},
transport::{Transport, TransportFactory},
};

pub use sentry_types::{
Expand All @@ -151,6 +155,22 @@ pub mod internals {
};
}

/// The provided transports.
///
/// This module exposes all transports that are compiled into the sentry
/// library. The `with_reqwest_transport` and `with_curl_transport` flags
/// turn on these transports.
pub mod transports {
#[cfg(any(feature = "with_reqwest_transport", feature = "with_curl_transport"))]
pub use crate::transport::{DefaultTransportFactory, HttpTransport};

#[cfg(feature = "with_reqwest_transport")]
pub use crate::transport::ReqwestHttpTransport;

#[cfg(feature = "with_curl_transport")]
pub use crate::transport::CurlHttpTransport;
}

// public api or exports from this crate
pub use crate::api::*;
pub use crate::hub::Hub;
Expand Down
Loading