use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
pub enum ServiceState {
Stateful = 0,
Stateless = 1,
Fixed = 2,
}
impl ServiceState {
pub fn stateful(&self) -> bool {
match self {
ServiceState::Stateful => true,
_ => false,
}
}
pub fn stateless(&self) -> bool {
match self {
ServiceState::Stateless => true,
_ => false,
}
}
pub fn fixed(&self) -> bool {
match self {
ServiceState::Fixed => true,
_ => false,
}
}
}
#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub enum Strategy {
Hash = 0,
ConsistentHash = 1,
RoundRobin = 2,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum DestinationRule {
Path(Strategy),
Header(String, Strategy)
}