mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 16:21:04 +00:00
21 lines
642 B
Rust
21 lines
642 B
Rust
use std::sync::OnceLock;
|
|
|
|
use crate::auth::{Auth, AuthInventory, AuthKind};
|
|
|
|
pub fn init_tests() {
|
|
static INIT: OnceLock<()> = OnceLock::new();
|
|
|
|
INIT.get_or_init(crate::init);
|
|
}
|
|
|
|
inventory::submit! {
|
|
AuthInventory {
|
|
get: |scheme, domain| match (scheme.as_str(), domain.as_ref()) {
|
|
("test-mount", "7z") => Some(Auth::new(AuthKind::Mount, scheme.clone(), "7z")),
|
|
("test-hub", _) => Some(Auth::new(AuthKind::Hub, scheme.clone(), domain.clone())),
|
|
("test-scope", "aws") => Some(Auth::new(AuthKind::Scope, scheme.clone(), "aws")),
|
|
("sftp", "vps") => Some(Auth::new(AuthKind::Sftp, scheme.clone(), "vps")),
|
|
_ => None,
|
|
},
|
|
}
|
|
}
|