feat: regex filter searches full name
This commit is contained in:
parent
d504c650dd
commit
1798ce3f4e
2 changed files with 7 additions and 2 deletions
|
@ -34,3 +34,7 @@ pub fn stringify_json(v: &serde_json::Value) -> String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// keep it as separate fn so we can change it everywhere easily
|
||||||
|
pub fn full_name(namespace: &str, name: &str) -> String {
|
||||||
|
format!("{namespace}:{name}")
|
||||||
|
}
|
||||||
|
|
|
@ -151,7 +151,8 @@ async fn run_collection_endpoints(
|
||||||
let env = std::sync::Arc::new(collection.env.unwrap_or_default());
|
let env = std::sync::Arc::new(collection.env.unwrap_or_default());
|
||||||
|
|
||||||
for (name, mut endpoint) in collection.route.unwrap_or_default() {
|
for (name, mut endpoint) in collection.route.unwrap_or_default() {
|
||||||
if pattern.find(&name).is_none() { continue };
|
let full_name = ext::full_name(&namespace, &name);
|
||||||
|
if pattern.find(&full_name).is_none() { continue };
|
||||||
|
|
||||||
if debug { endpoint.extract = Some(ext::StringOr::T(model::ExtractorConfig::Debug)) };
|
if debug { endpoint.extract = Some(ext::StringOr::T(model::ExtractorConfig::Debug)) };
|
||||||
let _client = client.clone();
|
let _client = client.clone();
|
||||||
|
@ -160,7 +161,7 @@ async fn run_collection_endpoints(
|
||||||
|
|
||||||
let task = async move {
|
let task = async move {
|
||||||
let before = chrono::Local::now();
|
let before = chrono::Local::now();
|
||||||
eprintln!(" : [{}] {_namespace}:{name} \tsending request...", before.format(fmt::TIMESTAMP_FMT));
|
eprintln!(" : [{}] {full_name} \tsending request...", before.format(fmt::TIMESTAMP_FMT));
|
||||||
|
|
||||||
let res = if dry_run {
|
let res = if dry_run {
|
||||||
Ok("".to_string())
|
Ok("".to_string())
|
||||||
|
|
Loading…
Reference in a new issue