mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-29 22:38:36 +08:00
Intermediate v2
This commit is contained in:
@@ -1,15 +1,27 @@
|
||||
use dashmap::DashMap;
|
||||
use std::any::type_name;
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub struct UpstreamsStruct {
|
||||
pub proto: String,
|
||||
pub path: String,
|
||||
pub address: (String, u16, bool),
|
||||
pub atom: AtomicUsize,
|
||||
pub fn print_upstreams(upstreams: &UpstresmDashMap) {
|
||||
for host_entry in upstreams.iter() {
|
||||
let hostname = host_entry.key();
|
||||
println!("Hostname: {}", hostname);
|
||||
|
||||
for path_entry in host_entry.value().iter() {
|
||||
let path = path_entry.key();
|
||||
println!(" Path: {}", path);
|
||||
|
||||
for (ip, port, ssl, proto) in path_entry.value().0.clone() {
|
||||
println!(" ===> IP: {}, Port: {}, SSL: {}, Proto: {}", ip, port, ssl, proto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type UpstresmDashMap = DashMap<String, DashMap<String, (Vec<(String, u16, bool, String)>, AtomicUsize)>>;
|
||||
pub type UpstreamMap = DashMap<String, (Vec<(String, u16)>, AtomicUsize)>;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn typeoff<T>(_: T) {
|
||||
let to = type_name::<T>();
|
||||
|
||||
Reference in New Issue
Block a user