#[derive(Clone, Debug)]
pub struct UidConfig {
pub port: String , pub time_bits: i32 , pub worker_bits: i32 , pub seq_bits: i32 , pub epoch_seconds: i64 , pub max_backward_seconds: i64 , pub enable_backward: bool, }
impl UidConfig {
pub fn new(port: String)-> Self {
UidConfig {
port ,
time_bits: 30,
worker_bits: 7,
seq_bits: 13,
epoch_seconds: 1550592000000 / 1000,
max_backward_seconds: 1,
enable_backward: true,
}
}
}