From 51b6b3752875f456169ee665586dd821393074e9 Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Fri, 29 Nov 2024 19:47:03 +0300 Subject: [PATCH] Delete out codegen files --- out/xray.app.log.command.rs | 129 ---------- out/xray.app.log.rs | 50 ---- out/xray.app.proxyman.command.rs | 407 ------------------------------- out/xray.app.proxyman.rs | 159 ------------ out/xray.app.stats.command.rs | 261 -------------------- out/xray.app.stats.rs | 12 - out/xray.common.log.rs | 36 --- out/xray.common.net.rs | 36 --- out/xray.common.protocol.rs | 13 - out/xray.common.serial.rs | 11 - out/xray.core.rs | 56 ----- out/xray.transport.internet.rs | 197 --------------- 12 files changed, 1367 deletions(-) delete mode 100644 out/xray.app.log.command.rs delete mode 100644 out/xray.app.log.rs delete mode 100644 out/xray.app.proxyman.command.rs delete mode 100644 out/xray.app.proxyman.rs delete mode 100644 out/xray.app.stats.command.rs delete mode 100644 out/xray.app.stats.rs delete mode 100644 out/xray.common.log.rs delete mode 100644 out/xray.common.net.rs delete mode 100644 out/xray.common.protocol.rs delete mode 100644 out/xray.common.serial.rs delete mode 100644 out/xray.core.rs delete mode 100644 out/xray.transport.internet.rs diff --git a/out/xray.app.log.command.rs b/out/xray.app.log.command.rs deleted file mode 100644 index d7bd312a..00000000 --- a/out/xray.app.log.command.rs +++ /dev/null @@ -1,129 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Config {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RestartLoggerRequest {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RestartLoggerResponse {} -/// Generated client implementations. -pub mod logger_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct LoggerServiceClient { - inner: tonic::client::Grpc, - } - impl LoggerServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl LoggerServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> LoggerServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - LoggerServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn restart_logger( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.log.command.LoggerService/RestartLogger", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.log.command.LoggerService", - "RestartLogger", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/out/xray.app.log.rs b/out/xray.app.log.rs deleted file mode 100644 index 68119581..00000000 --- a/out/xray.app.log.rs +++ /dev/null @@ -1,50 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Config { - #[prost(enumeration = "LogType", tag = "1")] - pub error_log_type: i32, - #[prost(enumeration = "super::super::common::log::Severity", tag = "2")] - pub error_log_level: i32, - #[prost(string, tag = "3")] - pub error_log_path: ::prost::alloc::string::String, - #[prost(enumeration = "LogType", tag = "4")] - pub access_log_type: i32, - #[prost(string, tag = "5")] - pub access_log_path: ::prost::alloc::string::String, - #[prost(bool, tag = "6")] - pub enable_dns_log: bool, - #[prost(string, tag = "7")] - pub mask_address: ::prost::alloc::string::String, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LogType { - None = 0, - Console = 1, - File = 2, - Event = 3, -} -impl LogType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::None => "None", - Self::Console => "Console", - Self::File => "File", - Self::Event => "Event", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "None" => Some(Self::None), - "Console" => Some(Self::Console), - "File" => Some(Self::File), - "Event" => Some(Self::Event), - _ => None, - } - } -} diff --git a/out/xray.app.proxyman.command.rs b/out/xray.app.proxyman.command.rs deleted file mode 100644 index 6f874abe..00000000 --- a/out/xray.app.proxyman.command.rs +++ /dev/null @@ -1,407 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddUserOperation { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveUserOperation { - #[prost(string, tag = "1")] - pub email: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddInboundRequest { - #[prost(message, optional, tag = "1")] - pub inbound: ::core::option::Option, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AddInboundResponse {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveInboundRequest { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RemoveInboundResponse {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AlterInboundRequest { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub operation: ::core::option::Option< - super::super::super::common::serial::TypedMessage, - >, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AlterInboundResponse {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetInboundUserRequest { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub email: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetInboundUserResponse { - #[prost(message, repeated, tag = "1")] - pub users: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct GetInboundUsersCountResponse { - #[prost(int64, tag = "1")] - pub count: i64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddOutboundRequest { - #[prost(message, optional, tag = "1")] - pub outbound: ::core::option::Option< - super::super::super::core::OutboundHandlerConfig, - >, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AddOutboundResponse {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveOutboundRequest { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RemoveOutboundResponse {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AlterOutboundRequest { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub operation: ::core::option::Option< - super::super::super::common::serial::TypedMessage, - >, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AlterOutboundResponse {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Config {} -/// Generated client implementations. -pub mod handler_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct HandlerServiceClient { - inner: tonic::client::Grpc, - } - impl HandlerServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl HandlerServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> HandlerServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - HandlerServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn add_inbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/AddInbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "AddInbound", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn remove_inbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/RemoveInbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "RemoveInbound", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn alter_inbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/AlterInbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "AlterInbound", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_inbound_users( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/GetInboundUsers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "GetInboundUsers", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_inbound_users_count( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/GetInboundUsersCount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "GetInboundUsersCount", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn add_outbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/AddOutbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "AddOutbound", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn remove_outbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/RemoveOutbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "RemoveOutbound", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn alter_outbound( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.proxyman.command.HandlerService/AlterOutbound", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.proxyman.command.HandlerService", - "AlterOutbound", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/out/xray.app.proxyman.rs b/out/xray.app.proxyman.rs deleted file mode 100644 index cc8e318a..00000000 --- a/out/xray.app.proxyman.rs +++ /dev/null @@ -1,159 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct InboundConfig {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AllocationStrategy { - #[prost(enumeration = "allocation_strategy::Type", tag = "1")] - pub r#type: i32, - /// Number of handlers (ports) running in parallel. - /// Default value is 3 if unset. - #[prost(message, optional, tag = "2")] - pub concurrency: ::core::option::Option< - allocation_strategy::AllocationStrategyConcurrency, - >, - /// Number of minutes before a handler is regenerated. - /// Default value is 5 if unset. - #[prost(message, optional, tag = "3")] - pub refresh: ::core::option::Option, -} -/// Nested message and enum types in `AllocationStrategy`. -pub mod allocation_strategy { - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct AllocationStrategyConcurrency { - #[prost(uint32, tag = "1")] - pub value: u32, - } - #[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct AllocationStrategyRefresh { - #[prost(uint32, tag = "1")] - pub value: u32, - } - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum Type { - /// Always allocate all connection handlers. - Always = 0, - /// Randomly allocate specific range of handlers. - Random = 1, - /// External. Not supported yet. - External = 2, - } - impl Type { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Always => "Always", - Self::Random => "Random", - Self::External => "External", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Always" => Some(Self::Always), - "Random" => Some(Self::Random), - "External" => Some(Self::External), - _ => None, - } - } - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SniffingConfig { - /// Whether or not to enable content sniffing on an inbound connection. - #[prost(bool, tag = "1")] - pub enabled: bool, - /// Override target destination if sniff'ed protocol is in the given list. - /// Supported values are "http", "tls", "fakedns". - #[prost(string, repeated, tag = "2")] - pub destination_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "3")] - pub domains_excluded: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Whether should only try to sniff metadata without waiting for client input. - /// Can be used to support SMTP like protocol where server send the first - /// message. - #[prost(bool, tag = "4")] - pub metadata_only: bool, - #[prost(bool, tag = "5")] - pub route_only: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReceiverConfig { - /// PortList specifies the ports which the Receiver should listen on. - #[prost(message, optional, tag = "1")] - pub port_list: ::core::option::Option, - /// Listen specifies the IP address that the Receiver should listen on. - #[prost(message, optional, tag = "2")] - pub listen: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub allocation_strategy: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub stream_settings: ::core::option::Option< - super::super::transport::internet::StreamConfig, - >, - #[prost(bool, tag = "5")] - pub receive_original_destination: bool, - #[prost(message, optional, tag = "7")] - pub sniffing_settings: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InboundHandlerConfig { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub receiver_settings: ::core::option::Option< - super::super::common::serial::TypedMessage, - >, - #[prost(message, optional, tag = "3")] - pub proxy_settings: ::core::option::Option< - super::super::common::serial::TypedMessage, - >, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct OutboundConfig {} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SenderConfig { - /// Send traffic through the given IP. Only IP is allowed. - #[prost(message, optional, tag = "1")] - pub via: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub stream_settings: ::core::option::Option< - super::super::transport::internet::StreamConfig, - >, - #[prost(message, optional, tag = "3")] - pub proxy_settings: ::core::option::Option< - super::super::transport::internet::ProxyConfig, - >, - #[prost(message, optional, tag = "4")] - pub multiplex_settings: ::core::option::Option, - #[prost(string, tag = "5")] - pub via_cidr: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MultiplexingConfig { - /// Whether or not Mux is enabled. - #[prost(bool, tag = "1")] - pub enabled: bool, - /// Max number of concurrent connections that one Mux connection can handle. - #[prost(int32, tag = "2")] - pub concurrency: i32, - /// Transport XUDP in another Mux. - #[prost(int32, tag = "3")] - pub xudp_concurrency: i32, - /// "reject" (default), "allow" or "skip". - #[prost(string, tag = "4")] - pub xudp_proxy_udp443: ::prost::alloc::string::String, -} diff --git a/out/xray.app.stats.command.rs b/out/xray.app.stats.command.rs deleted file mode 100644 index c97d40ec..00000000 --- a/out/xray.app.stats.command.rs +++ /dev/null @@ -1,261 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStatsRequest { - /// Name of the stat counter. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Whether or not to reset the counter to fetching its value. - #[prost(bool, tag = "2")] - pub reset: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Stat { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(int64, tag = "2")] - pub value: i64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStatsResponse { - #[prost(message, optional, tag = "1")] - pub stat: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryStatsRequest { - #[prost(string, tag = "1")] - pub pattern: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub reset: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryStatsResponse { - #[prost(message, repeated, tag = "1")] - pub stat: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct SysStatsRequest {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct SysStatsResponse { - #[prost(uint32, tag = "1")] - pub num_goroutine: u32, - #[prost(uint32, tag = "2")] - pub num_gc: u32, - #[prost(uint64, tag = "3")] - pub alloc: u64, - #[prost(uint64, tag = "4")] - pub total_alloc: u64, - #[prost(uint64, tag = "5")] - pub sys: u64, - #[prost(uint64, tag = "6")] - pub mallocs: u64, - #[prost(uint64, tag = "7")] - pub frees: u64, - #[prost(uint64, tag = "8")] - pub live_objects: u64, - #[prost(uint64, tag = "9")] - pub pause_total_ns: u64, - #[prost(uint32, tag = "10")] - pub uptime: u32, -} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Config {} -/// Generated client implementations. -pub mod stats_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct StatsServiceClient { - inner: tonic::client::Grpc, - } - impl StatsServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl StatsServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> StatsServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - StatsServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn get_stats( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.stats.command.StatsService/GetStats", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("xray.app.stats.command.StatsService", "GetStats"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_stats_online( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.stats.command.StatsService/GetStatsOnline", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "xray.app.stats.command.StatsService", - "GetStatsOnline", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn query_stats( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.stats.command.StatsService/QueryStats", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("xray.app.stats.command.StatsService", "QueryStats"), - ); - self.inner.unary(req, path, codec).await - } - pub async fn get_sys_stats( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/xray.app.stats.command.StatsService/GetSysStats", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("xray.app.stats.command.StatsService", "GetSysStats"), - ); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/out/xray.app.stats.rs b/out/xray.app.stats.rs deleted file mode 100644 index d4e80188..00000000 --- a/out/xray.app.stats.rs +++ /dev/null @@ -1,12 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct Config {} -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ChannelConfig { - #[prost(bool, tag = "1")] - pub blocking: bool, - #[prost(int32, tag = "2")] - pub subscriber_limit: i32, - #[prost(int32, tag = "3")] - pub buffer_size: i32, -} diff --git a/out/xray.common.log.rs b/out/xray.common.log.rs deleted file mode 100644 index 14c7cd48..00000000 --- a/out/xray.common.log.rs +++ /dev/null @@ -1,36 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Severity { - Unknown = 0, - Error = 1, - Warning = 2, - Info = 3, - Debug = 4, -} -impl Severity { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unknown => "Unknown", - Self::Error => "Error", - Self::Warning => "Warning", - Self::Info => "Info", - Self::Debug => "Debug", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Unknown" => Some(Self::Unknown), - "Error" => Some(Self::Error), - "Warning" => Some(Self::Warning), - "Info" => Some(Self::Info), - "Debug" => Some(Self::Debug), - _ => None, - } - } -} diff --git a/out/xray.common.net.rs b/out/xray.common.net.rs deleted file mode 100644 index 0e09c942..00000000 --- a/out/xray.common.net.rs +++ /dev/null @@ -1,36 +0,0 @@ -// This file is @generated by prost-build. -/// Address of a network host. It may be either an IP address or a domain -/// address. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IpOrDomain { - #[prost(oneof = "ip_or_domain::Address", tags = "1, 2")] - pub address: ::core::option::Option, -} -/// Nested message and enum types in `IPOrDomain`. -pub mod ip_or_domain { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Address { - /// IP address. Must by either 4 or 16 bytes. - #[prost(bytes, tag = "1")] - Ip(::prost::alloc::vec::Vec), - /// Domain address. - #[prost(string, tag = "2")] - Domain(::prost::alloc::string::String), - } -} -/// PortRange represents a range of ports. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct PortRange { - /// The port that this range starts from. - #[prost(uint32, tag = "1")] - pub from: u32, - /// The port that this range ends with (inclusive). - #[prost(uint32, tag = "2")] - pub to: u32, -} -/// PortList is a list of ports. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PortList { - #[prost(message, repeated, tag = "1")] - pub range: ::prost::alloc::vec::Vec, -} diff --git a/out/xray.common.protocol.rs b/out/xray.common.protocol.rs deleted file mode 100644 index e29a0be8..00000000 --- a/out/xray.common.protocol.rs +++ /dev/null @@ -1,13 +0,0 @@ -// This file is @generated by prost-build. -/// User is a generic user for all protocols. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct User { - #[prost(uint32, tag = "1")] - pub level: u32, - #[prost(string, tag = "2")] - pub email: ::prost::alloc::string::String, - /// Protocol specific account information. Must be the account proto in one of - /// the proxies. - #[prost(message, optional, tag = "3")] - pub account: ::core::option::Option, -} diff --git a/out/xray.common.serial.rs b/out/xray.common.serial.rs deleted file mode 100644 index c7de5bed..00000000 --- a/out/xray.common.serial.rs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is @generated by prost-build. -/// TypedMessage is a serialized proto message along with its type name. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TypedMessage { - /// The name of the message type, retrieved from protobuf API. - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - /// Serialized proto message. - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} diff --git a/out/xray.core.rs b/out/xray.core.rs deleted file mode 100644 index 0fd7ec6b..00000000 --- a/out/xray.core.rs +++ /dev/null @@ -1,56 +0,0 @@ -// This file is @generated by prost-build. -/// Config is the master config of Xray. Xray takes this config as input and -/// functions accordingly. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Config { - /// Inbound handler configurations. Must have at least one item. - #[prost(message, repeated, tag = "1")] - pub inbound: ::prost::alloc::vec::Vec, - /// Outbound handler configurations. Must have at least one item. The first - /// item is used as default for routing. - #[prost(message, repeated, tag = "2")] - pub outbound: ::prost::alloc::vec::Vec, - /// App is for configurations of all features in Xray. A feature must - /// implement the Feature interface, and its config type must be registered - /// through common.RegisterConfig. - #[prost(message, repeated, tag = "4")] - pub app: ::prost::alloc::vec::Vec, - /// Configuration for extensions. The config may not work if corresponding - /// extension is not loaded into Xray. Xray will ignore such config during - /// initialization. - #[prost(message, repeated, tag = "6")] - pub extension: ::prost::alloc::vec::Vec, -} -/// InboundHandlerConfig is the configuration for inbound handler. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InboundHandlerConfig { - /// Tag of the inbound handler. The tag must be unique among all inbound - /// handlers - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - /// Settings for how this inbound proxy is handled. - #[prost(message, optional, tag = "2")] - pub receiver_settings: ::core::option::Option, - /// Settings for inbound proxy. Must be one of the inbound proxies. - #[prost(message, optional, tag = "3")] - pub proxy_settings: ::core::option::Option, -} -/// OutboundHandlerConfig is the configuration for outbound handler. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct OutboundHandlerConfig { - /// Tag of this outbound handler. - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - /// Settings for how to dial connection for this outbound handler. - #[prost(message, optional, tag = "2")] - pub sender_settings: ::core::option::Option, - /// Settings for this outbound proxy. Must be one of the outbound proxies. - #[prost(message, optional, tag = "3")] - pub proxy_settings: ::core::option::Option, - /// If not zero, this outbound will be expired in seconds. Not used for now. - #[prost(int64, tag = "4")] - pub expire: i64, - /// Comment of this outbound handler. Not used for now. - #[prost(string, tag = "5")] - pub comment: ::prost::alloc::string::String, -} diff --git a/out/xray.transport.internet.rs b/out/xray.transport.internet.rs deleted file mode 100644 index c51dfce8..00000000 --- a/out/xray.transport.internet.rs +++ /dev/null @@ -1,197 +0,0 @@ -// This file is @generated by prost-build. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransportConfig { - /// Type of network that this settings supports. - #[prost(string, tag = "3")] - pub protocol_name: ::prost::alloc::string::String, - /// Specific settings. Must be of the transports. - #[prost(message, optional, tag = "2")] - pub settings: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StreamConfig { - #[prost(message, optional, tag = "8")] - pub address: ::core::option::Option, - #[prost(uint32, tag = "9")] - pub port: u32, - /// Effective network. - #[prost(string, tag = "5")] - pub protocol_name: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub transport_settings: ::prost::alloc::vec::Vec, - /// Type of security. Must be a message name of the settings proto. - #[prost(string, tag = "3")] - pub security_type: ::prost::alloc::string::String, - /// Settings for transport security. For now the only choice is TLS. - #[prost(message, repeated, tag = "4")] - pub security_settings: ::prost::alloc::vec::Vec< - super::super::common::serial::TypedMessage, - >, - #[prost(message, optional, tag = "6")] - pub socket_settings: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProxyConfig { - #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub transport_layer_proxy: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CustomSockopt { - #[prost(string, tag = "1")] - pub level: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub opt: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub value: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub r#type: ::prost::alloc::string::String, -} -/// SocketConfig is options to be applied on network sockets. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SocketConfig { - /// Mark of the connection. If non-zero, the value will be set to SO_MARK. - #[prost(int32, tag = "1")] - pub mark: i32, - /// TFO is the state of TFO settings. - #[prost(int32, tag = "2")] - pub tfo: i32, - /// TProxy is for enabling TProxy socket option. - #[prost(enumeration = "socket_config::TProxyMode", tag = "3")] - pub tproxy: i32, - /// ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket - /// option. This option is for UDP only. - #[prost(bool, tag = "4")] - pub receive_original_dest_address: bool, - #[prost(bytes = "vec", tag = "5")] - pub bind_address: ::prost::alloc::vec::Vec, - #[prost(uint32, tag = "6")] - pub bind_port: u32, - #[prost(bool, tag = "7")] - pub accept_proxy_protocol: bool, - #[prost(enumeration = "DomainStrategy", tag = "8")] - pub domain_strategy: i32, - #[prost(string, tag = "9")] - pub dialer_proxy: ::prost::alloc::string::String, - #[prost(int32, tag = "10")] - pub tcp_keep_alive_interval: i32, - #[prost(int32, tag = "11")] - pub tcp_keep_alive_idle: i32, - #[prost(string, tag = "12")] - pub tcp_congestion: ::prost::alloc::string::String, - #[prost(string, tag = "13")] - pub interface: ::prost::alloc::string::String, - #[prost(bool, tag = "14")] - pub v6only: bool, - #[prost(int32, tag = "15")] - pub tcp_window_clamp: i32, - #[prost(int32, tag = "16")] - pub tcp_user_timeout: i32, - #[prost(int32, tag = "17")] - pub tcp_max_seg: i32, - #[prost(bool, tag = "18")] - pub tcp_no_delay: bool, - #[prost(bool, tag = "19")] - pub tcp_mptcp: bool, - #[prost(message, repeated, tag = "20")] - pub custom_sockopt: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `SocketConfig`. -pub mod socket_config { - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum TProxyMode { - /// TProxy is off. - Off = 0, - /// TProxy mode. - TProxy = 1, - /// Redirect mode. - Redirect = 2, - } - impl TProxyMode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Off => "Off", - Self::TProxy => "TProxy", - Self::Redirect => "Redirect", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Off" => Some(Self::Off), - "TProxy" => Some(Self::TProxy), - "Redirect" => Some(Self::Redirect), - _ => None, - } - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum DomainStrategy { - AsIs = 0, - UseIp = 1, - UseIp4 = 2, - UseIp6 = 3, - UseIp46 = 4, - UseIp64 = 5, - ForceIp = 6, - ForceIp4 = 7, - ForceIp6 = 8, - ForceIp46 = 9, - ForceIp64 = 10, -} -impl DomainStrategy { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::AsIs => "AS_IS", - Self::UseIp => "USE_IP", - Self::UseIp4 => "USE_IP4", - Self::UseIp6 => "USE_IP6", - Self::UseIp46 => "USE_IP46", - Self::UseIp64 => "USE_IP64", - Self::ForceIp => "FORCE_IP", - Self::ForceIp4 => "FORCE_IP4", - Self::ForceIp6 => "FORCE_IP6", - Self::ForceIp46 => "FORCE_IP46", - Self::ForceIp64 => "FORCE_IP64", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "AS_IS" => Some(Self::AsIs), - "USE_IP" => Some(Self::UseIp), - "USE_IP4" => Some(Self::UseIp4), - "USE_IP6" => Some(Self::UseIp6), - "USE_IP46" => Some(Self::UseIp46), - "USE_IP64" => Some(Self::UseIp64), - "FORCE_IP" => Some(Self::ForceIp), - "FORCE_IP4" => Some(Self::ForceIp4), - "FORCE_IP6" => Some(Self::ForceIp6), - "FORCE_IP46" => Some(Self::ForceIp46), - "FORCE_IP64" => Some(Self::ForceIp64), - _ => None, - } - } -}