yeahyf_auth_service 0.1.0

yeahyf example
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![allow(dead_code, unused_variables)]
use rand::Rng;

mod auth_utils;
mod database;

pub use auth_utils::models::Credentials;

pub fn authenticate(creds: Credentials) {
    let timeout = rand::rng().random_range(100..=500);
    println!("timeout is = {timeout}");
    // 模式匹配的一种简单方式
    if let database::Status::Connected = database::connect_to_database() {
        auth_utils::login(creds);
    }
}