From 218db3a175df35949e2dab947ec0aadcc807d52c Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 19 Oct 2024 04:55:20 +0200 Subject: [PATCH] feat: allow discarding output completely --- postwoman.toml | 4 ++++ src/main.rs | 4 ++-- src/model.rs | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/postwoman.toml b/postwoman.toml index 60e570e..324b327 100644 --- a/postwoman.toml +++ b/postwoman.toml @@ -4,6 +4,10 @@ user_agent = "postwoman@sample/0.2.0" [route.healthcheck] url = "https://api.alemi.dev/" +[route.benchmark] +url = "https://api.alemi.dev/look/into/the/void" +extract = { type = "discard" } + [route.debug] url = "https://api.alemi.dev/debug" method = "PUT" diff --git a/src/main.rs b/src/main.rs index f79cb86..fe1171d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,8 +56,8 @@ fn print_results(res: String, name: String, before: chrono::DateTime todo!(), - StringOr::T(Extractor::Debug) => format!("{res:#?}"), + StringOr::T(Extractor::Discard) => "".to_string(), + StringOr::T(Extractor::Debug) => format!("{res:#?}\n"), StringOr::T(Extractor::Body) => res.text().await?, StringOr::T(Extractor::Header { key }) => res .headers() @@ -181,6 +182,7 @@ pub enum Extractor { #[default] Debug, Body, + Discard, // JQL { query: String }, // Regex { pattern: String }, Header { key: String },