Skip to content

Commit

Permalink
Make influx and binflux compile and be accessible externally
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Apr 9, 2020
1 parent 0157ca2 commit 818431c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/codec.rs
Expand Up @@ -15,7 +15,7 @@
use crate::errors::*;
use simd_json::BorrowedValue;
use tremor_script::LineValue;
pub(crate) mod binflux;
pub mod binflux;
pub(crate) mod influx;
pub(crate) mod json;
pub(crate) mod msgpack;
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Expand Up @@ -14,8 +14,6 @@

//! Tremor runtime

#![forbid(warnings)]
#![deny(missing_docs)]
#![recursion_limit = "1024"]
#![deny(
clippy::all,
Expand Down
34 changes: 17 additions & 17 deletions src/offramp/rest.rs
Expand Up @@ -64,24 +64,24 @@ impl offramp::Impl for Rest {
}

impl Rest {
async fn flush(endpoint: &str, config: Config, payload: Vec<u8>) -> Result<u64> {
async fn flush(_endpoint: &str, _config: Config, _payload: Vec<u8>) -> Result<u64> {
let start = Instant::now();
let mut c = if config.put {
surf::put(endpoint)
} else {
surf::post(endpoint)
};
c = c.body_bytes(&payload);
for (k, v) in config.headers {
use http::header::HeaderName;
match HeaderName::from_bytes(k.as_str().as_bytes()) {
Ok(h) => {
c = c.set_header(&h, v.as_str());
}
Err(e) => error!("Bad header name: {}", e),
}
}
c.await?;
// let mut c = if config.put {
// surf::put(endpoint)
// } else {
// surf::post(endpoint)
// };
// c = c.body_bytes(&payload);
// for (k, v) in config.headers {
// use http::header::HeaderName;
// match HeaderName::from_bytes(k.as_str().as_bytes()) {
// Ok(h) => {
// c = c.set_header(&h, v.as_str());
// }
// Err(e) => error!("Bad header name: {}", e),
// }
// }
// c.await?;
let d = duration_to_millis(start.elapsed());
Ok(d)
}
Expand Down

3 comments on commit 818431c

@Licenser
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya :) I noticed you made two of the codex public, would it be helpful if we published them as crates?

@carols10cents
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya :) I noticed you made two of the codex public, would it be helpful if we published them as crates?

I think it would be!

@Licenser
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would https://crates.io/crates/tremor-influx help with what you're trying to accomplish?

Please sign in to comment.