rustfmt, fixed ip hash issue
This commit is contained in:
@@ -1,24 +1,18 @@
|
||||
pub mod round_robin;
|
||||
pub mod adaptive_weight;
|
||||
pub mod least_connections;
|
||||
pub mod ip_hashing;
|
||||
pub mod least_connections;
|
||||
pub mod round_robin;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::sync::Arc;
|
||||
use crate::backend::Backend;
|
||||
use std::cell::RefCell;
|
||||
use std::net::{SocketAddr};
|
||||
use std::fmt::Debug;
|
||||
use std::net::IpAddr;
|
||||
use std::sync::Arc;
|
||||
|
||||
thread_local! {
|
||||
pub static CURRENT_CONNECTION_INFO: RefCell<Option<ConnectionInfo>> = RefCell::new(None);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ConnectionInfo {
|
||||
pub client_ip : SocketAddr,
|
||||
pub client_ip: IpAddr,
|
||||
}
|
||||
|
||||
pub trait Balancer: Debug + Send + Sync + 'static {
|
||||
fn choose_backend(&mut self) -> Option<Arc<Backend>>;
|
||||
fn choose_backend(&mut self, ctx: ConnectionInfo) -> Option<Arc<Backend>>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user