use crate::model::provider::Provider;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Model {
pub name: String,
pub providers: Vec<Provider>,
pub lb: LbStrategy,
pub total_weight: u32,
#[serde(skip)]
pub round_robin_index: u64,
}
impl PartialEq for Model {
fn eq(&self, other: &Self) -> bool {
self.name == other.name
&& self.providers == other.providers
&& self.lb == other.lb
&& self.total_weight == other.total_weight
}
}
impl Eq for Model {}
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)]
pub enum LbStrategy {
#[default]
Random,
RoundRobin,
WeightedRandom,
}