Move config models to src

This commit is contained in:
Keivan-sf
2023-11-07 16:36:30 +03:30
parent c4ee41d11b
commit 4dc9f385af
4 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
use crate::config_models;
use std::process::exit;
use self::config_models::{Config, Outbound};
pub mod config_models;
mod uri_identifier;
mod vless;
@@ -11,16 +10,16 @@ pub fn create_json_config(uri: &str, socks_port: Option<u16>) -> String {
return serialized;
}
pub fn create_config(uri: &str, socks_port: Option<u16>) -> Config {
pub fn create_config(uri: &str, socks_port: Option<u16>) -> config_models::Config {
let outbound_object = create_outbound_object(uri);
let config = Config {
let config = config_models::Config {
outbounds: vec![outbound_object],
inbounds: None,
};
return config;
}
pub fn create_outbound_object(uri: &str) -> Outbound {
pub fn create_outbound_object(uri: &str) -> config_models::Outbound {
let protocol = uri_identifier::get_uri_protocol(uri);
match protocol {
Some(uri_identifier::Protocols::Vless) => {