pub mod uploader_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 UploaderServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl UploaderServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> UploaderServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> UploaderServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
UploaderServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
}
}
pub mod uploader_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait UploaderService: std::marker::Send + std::marker::Sync + 'static {}
#[derive(Debug)]
pub struct UploaderServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> UploaderServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for UploaderServiceServer<T>
where
T: UploaderService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for UploaderServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "uploader.v1.UploaderService";
impl<T> tonic::server::NamedService for UploaderServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataStorageOptions {
#[prost(enumeration = "AvailableDataStorages", tag = "1")]
pub storage: i32,
#[prost(string, tag = "2")]
pub data_dir: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub dir_structure: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub force_fsync: bool,
#[prost(string, optional, tag = "10")]
pub s3_bucket: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub s3_region: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub s3_access_key: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "13")]
pub s3_access_key_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "14")]
pub s3_secret_key: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "15")]
pub s3_secret_key_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "16")]
pub s3_url: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "17")]
pub s3_force_path_style: bool,
#[prost(string, optional, tag = "18")]
pub s3_security_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "19")]
pub s3_session_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "20")]
pub s3_profile: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "21")]
pub s3_headers: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, tag = "22")]
pub s3_concat_concurrent_downloads: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InfoStoreOptions {
#[prost(enumeration = "AvailableInfoStorages", tag = "1")]
pub info_storage: i32,
#[prost(string, tag = "2")]
pub info_dir: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub info_db_dsn: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "4")]
pub redis_info_expiration: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmqpHooksOptions {
#[prost(string, optional, tag = "1")]
pub url: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "2")]
pub declare_exchange: bool,
#[prost(bool, tag = "3")]
pub declare_queues: bool,
#[prost(bool, tag = "4")]
pub durable_exchange: bool,
#[prost(bool, tag = "5")]
pub durable_queues: bool,
#[prost(bool, tag = "6")]
pub celery: bool,
#[prost(string, tag = "10")]
pub exchange: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub exchange_kind: ::prost::alloc::string::String,
#[prost(string, optional, tag = "12")]
pub routing_key: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "13")]
pub queues_prefix: ::prost::alloc::string::String,
#[prost(uint64, tag = "14")]
pub connection_pool_size: u64,
#[prost(uint64, tag = "15")]
pub channel_pool_size: u64,
#[prost(uint64, optional, tag = "16")]
pub idle_connection_timeout: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "17")]
pub idle_channels_timeout: ::core::option::Option<u64>,
#[prost(bool, tag = "18")]
pub auto_delete: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KafkaHookOptions {
#[prost(string, optional, tag = "1")]
pub urls: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub client_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub required_acks: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub compression: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "7")]
pub idle_timeout: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "8")]
pub send_timeout: ::core::option::Option<u64>,
#[prost(map = "string, string", tag = "20")]
pub extra_kafka_opts: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(oneof = "kafka_hook_options::TopicOrPrefix", tags = "3, 4")]
pub topic_or_prefix: ::core::option::Option<kafka_hook_options::TopicOrPrefix>,
}
pub mod kafka_hook_options {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TopicOrPrefix {
#[prost(string, tag = "3")]
Topic(::prost::alloc::string::String),
#[prost(string, tag = "4")]
Prefix(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NatsHookOptions {
#[prost(string, repeated, tag = "1")]
pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "4")]
pub wait_for_replies: bool,
#[prost(string, optional, tag = "10")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(oneof = "nats_hook_options::SubjectOrPrefix", tags = "2, 3")]
pub subject_or_prefix: ::core::option::Option<nats_hook_options::SubjectOrPrefix>,
}
pub mod nats_hook_options {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SubjectOrPrefix {
#[prost(string, tag = "2")]
Subject(::prost::alloc::string::String),
#[prost(string, tag = "3")]
Prefix(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationsOptions {
#[prost(enumeration = "Format", tag = "1")]
pub hooks_format: i32,
#[prost(enumeration = "Hook", repeated, tag = "2")]
pub hooks: ::prost::alloc::vec::Vec<i32>,
#[prost(bool, tag = "3")]
pub behind_proxy: bool,
#[prost(string, repeated, tag = "4")]
pub hooks_http_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "5")]
pub http_hook_timeout: ::core::option::Option<u64>,
#[prost(string, repeated, tag = "6")]
pub hooks_http_proxy_headers: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "10")]
pub hooks_dir: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub hooks_file: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "20")]
pub amqp_hook_opts: ::core::option::Option<AmqpHooksOptions>,
#[prost(message, optional, tag = "21")]
pub kafka_hook_opts: ::core::option::Option<KafkaHookOptions>,
#[prost(message, optional, tag = "22")]
pub nats_hook_opts: ::core::option::Option<NatsHookOptions>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SentryOptions {
#[prost(string, optional, tag = "1")]
pub dsn: ::core::option::Option<::prost::alloc::string::String>,
#[prost(float, tag = "2")]
pub sample_rate: f32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RustusConf {
#[prost(string, tag = "1")]
pub host: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub port: u32,
#[prost(bool, tag = "3")]
pub disable_health_access_log: bool,
#[prost(string, tag = "4")]
pub url: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "10")]
pub cors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint64, tag = "11")]
pub max_body_size: u64,
#[prost(string, tag = "12")]
pub log_level: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "13")]
pub workers: ::core::option::Option<u64>,
#[prost(enumeration = "Extension", repeated, tag = "14")]
pub tus_extensions: ::prost::alloc::vec::Vec<i32>,
#[prost(bool, tag = "15")]
pub allow_empty: bool,
#[prost(bool, tag = "16")]
pub remove_parts: bool,
#[prost(uint64, optional, tag = "17")]
pub max_file_size: ::core::option::Option<u64>,
#[prost(message, optional, tag = "20")]
pub storage_opts: ::core::option::Option<DataStorageOptions>,
#[prost(message, optional, tag = "21")]
pub info_storage_opts: ::core::option::Option<InfoStoreOptions>,
#[prost(message, optional, tag = "22")]
pub notification_opts: ::core::option::Option<NotificationsOptions>,
#[prost(message, optional, tag = "23")]
pub sentry_opts: ::core::option::Option<SentryOptions>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AvailableDataStorages {
Unspecified = 0,
FileStorage = 1,
S3 = 2,
HybridS3 = 3,
}
impl AvailableDataStorages {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "AVAILABLE_DATA_STORAGES_UNSPECIFIED",
Self::FileStorage => "FILE_STORAGE",
Self::S3 => "S3",
Self::HybridS3 => "HYBRID_S3",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AVAILABLE_DATA_STORAGES_UNSPECIFIED" => Some(Self::Unspecified),
"FILE_STORAGE" => Some(Self::FileStorage),
"S3" => Some(Self::S3),
"HYBRID_S3" => Some(Self::HybridS3),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AvailableInfoStorages {
Unspecified = 0,
Files = 1,
Redis = 2,
Postgres = 3,
}
impl AvailableInfoStorages {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "AVAILABLE_INFO_STORAGES_UNSPECIFIED",
Self::Files => "FILES",
Self::Redis => "REDIS",
Self::Postgres => "POSTGRES",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AVAILABLE_INFO_STORAGES_UNSPECIFIED" => Some(Self::Unspecified),
"FILES" => Some(Self::Files),
"REDIS" => Some(Self::Redis),
"POSTGRES" => Some(Self::Postgres),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Hook {
Unspecified = 0,
PreCreate = 1,
PostCreate = 2,
PostReceive = 3,
PreTerminate = 4,
PostTerminate = 5,
PostFinish = 6,
}
impl Hook {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "HOOK_UNSPECIFIED",
Self::PreCreate => "PRE_CREATE",
Self::PostCreate => "POST_CREATE",
Self::PostReceive => "POST_RECEIVE",
Self::PreTerminate => "PRE_TERMINATE",
Self::PostTerminate => "POST_TERMINATE",
Self::PostFinish => "POST_FINISH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HOOK_UNSPECIFIED" => Some(Self::Unspecified),
"PRE_CREATE" => Some(Self::PreCreate),
"POST_CREATE" => Some(Self::PostCreate),
"POST_RECEIVE" => Some(Self::PostReceive),
"PRE_TERMINATE" => Some(Self::PreTerminate),
"POST_TERMINATE" => Some(Self::PostTerminate),
"POST_FINISH" => Some(Self::PostFinish),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Format {
Unspecified = 0,
Default = 1,
V2 = 2,
}
impl Format {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "FORMAT_UNSPECIFIED",
Self::Default => "DEFAULT",
Self::V2 => "V2",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
"DEFAULT" => Some(Self::Default),
"V2" => Some(Self::V2),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Extension {
Unspecified = 0,
Getting = 1,
Creation = 2,
CreationWithUpload = 3,
CreationDeferLength = 4,
Termination = 5,
Concatenation = 6,
Checksum = 7,
}
impl Extension {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXTENSION_UNSPECIFIED",
Self::Getting => "GETTING",
Self::Creation => "CREATION",
Self::CreationWithUpload => "CREATION_WITH_UPLOAD",
Self::CreationDeferLength => "CREATION_DEFER_LENGTH",
Self::Termination => "TERMINATION",
Self::Concatenation => "CONCATENATION",
Self::Checksum => "CHECKSUM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXTENSION_UNSPECIFIED" => Some(Self::Unspecified),
"GETTING" => Some(Self::Getting),
"CREATION" => Some(Self::Creation),
"CREATION_WITH_UPLOAD" => Some(Self::CreationWithUpload),
"CREATION_DEFER_LENGTH" => Some(Self::CreationDeferLength),
"TERMINATION" => Some(Self::Termination),
"CONCATENATION" => Some(Self::Concatenation),
"CHECKSUM" => Some(Self::Checksum),
_ => None,
}
}
}