1pub mod uploader_service_client {
4 #![allow(
5 unused_variables,
6 dead_code,
7 missing_docs,
8 clippy::wildcard_imports,
9 clippy::let_unit_value,
10 )]
11 use tonic::codegen::*;
12 use tonic::codegen::http::Uri;
13 #[derive(Debug, Clone)]
14 pub struct UploaderServiceClient<T> {
15 inner: tonic::client::Grpc<T>,
16 }
17 impl UploaderServiceClient<tonic::transport::Channel> {
18 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
20 where
21 D: TryInto<tonic::transport::Endpoint>,
22 D::Error: Into<StdError>,
23 {
24 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
25 Ok(Self::new(conn))
26 }
27 }
28 impl<T> UploaderServiceClient<T>
29 where
30 T: tonic::client::GrpcService<tonic::body::Body>,
31 T::Error: Into<StdError>,
32 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
33 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
34 {
35 pub fn new(inner: T) -> Self {
36 let inner = tonic::client::Grpc::new(inner);
37 Self { inner }
38 }
39 pub fn with_origin(inner: T, origin: Uri) -> Self {
40 let inner = tonic::client::Grpc::with_origin(inner, origin);
41 Self { inner }
42 }
43 pub fn with_interceptor<F>(
44 inner: T,
45 interceptor: F,
46 ) -> UploaderServiceClient<InterceptedService<T, F>>
47 where
48 F: tonic::service::Interceptor,
49 T::ResponseBody: Default,
50 T: tonic::codegen::Service<
51 http::Request<tonic::body::Body>,
52 Response = http::Response<
53 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
54 >,
55 >,
56 <T as tonic::codegen::Service<
57 http::Request<tonic::body::Body>,
58 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
59 {
60 UploaderServiceClient::new(InterceptedService::new(inner, interceptor))
61 }
62 #[must_use]
67 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
68 self.inner = self.inner.send_compressed(encoding);
69 self
70 }
71 #[must_use]
73 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
74 self.inner = self.inner.accept_compressed(encoding);
75 self
76 }
77 #[must_use]
81 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
82 self.inner = self.inner.max_decoding_message_size(limit);
83 self
84 }
85 #[must_use]
89 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
90 self.inner = self.inner.max_encoding_message_size(limit);
91 self
92 }
93 }
94}
95pub mod uploader_service_server {
97 #![allow(
98 unused_variables,
99 dead_code,
100 missing_docs,
101 clippy::wildcard_imports,
102 clippy::let_unit_value,
103 )]
104 use tonic::codegen::*;
105 #[async_trait]
107 pub trait UploaderService: std::marker::Send + std::marker::Sync + 'static {}
108 #[derive(Debug)]
109 pub struct UploaderServiceServer<T> {
110 inner: Arc<T>,
111 accept_compression_encodings: EnabledCompressionEncodings,
112 send_compression_encodings: EnabledCompressionEncodings,
113 max_decoding_message_size: Option<usize>,
114 max_encoding_message_size: Option<usize>,
115 }
116 impl<T> UploaderServiceServer<T> {
117 pub fn new(inner: T) -> Self {
118 Self::from_arc(Arc::new(inner))
119 }
120 pub fn from_arc(inner: Arc<T>) -> Self {
121 Self {
122 inner,
123 accept_compression_encodings: Default::default(),
124 send_compression_encodings: Default::default(),
125 max_decoding_message_size: None,
126 max_encoding_message_size: None,
127 }
128 }
129 pub fn with_interceptor<F>(
130 inner: T,
131 interceptor: F,
132 ) -> InterceptedService<Self, F>
133 where
134 F: tonic::service::Interceptor,
135 {
136 InterceptedService::new(Self::new(inner), interceptor)
137 }
138 #[must_use]
140 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
141 self.accept_compression_encodings.enable(encoding);
142 self
143 }
144 #[must_use]
146 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
147 self.send_compression_encodings.enable(encoding);
148 self
149 }
150 #[must_use]
154 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
155 self.max_decoding_message_size = Some(limit);
156 self
157 }
158 #[must_use]
162 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
163 self.max_encoding_message_size = Some(limit);
164 self
165 }
166 }
167 impl<T, B> tonic::codegen::Service<http::Request<B>> for UploaderServiceServer<T>
168 where
169 T: UploaderService,
170 B: Body + std::marker::Send + 'static,
171 B::Error: Into<StdError> + std::marker::Send + 'static,
172 {
173 type Response = http::Response<tonic::body::Body>;
174 type Error = std::convert::Infallible;
175 type Future = BoxFuture<Self::Response, Self::Error>;
176 fn poll_ready(
177 &mut self,
178 _cx: &mut Context<'_>,
179 ) -> Poll<std::result::Result<(), Self::Error>> {
180 Poll::Ready(Ok(()))
181 }
182 fn call(&mut self, req: http::Request<B>) -> Self::Future {
183 match req.uri().path() {
184 _ => {
185 Box::pin(async move {
186 let mut response = http::Response::new(
187 tonic::body::Body::default(),
188 );
189 let headers = response.headers_mut();
190 headers
191 .insert(
192 tonic::Status::GRPC_STATUS,
193 (tonic::Code::Unimplemented as i32).into(),
194 );
195 headers
196 .insert(
197 http::header::CONTENT_TYPE,
198 tonic::metadata::GRPC_CONTENT_TYPE,
199 );
200 Ok(response)
201 })
202 }
203 }
204 }
205 }
206 impl<T> Clone for UploaderServiceServer<T> {
207 fn clone(&self) -> Self {
208 let inner = self.inner.clone();
209 Self {
210 inner,
211 accept_compression_encodings: self.accept_compression_encodings,
212 send_compression_encodings: self.send_compression_encodings,
213 max_decoding_message_size: self.max_decoding_message_size,
214 max_encoding_message_size: self.max_encoding_message_size,
215 }
216 }
217 }
218 pub const SERVICE_NAME: &str = "uploader.v1.UploaderService";
220 impl<T> tonic::server::NamedService for UploaderServiceServer<T> {
221 const NAME: &'static str = SERVICE_NAME;
222 }
223}
224#[derive(serde::Serialize, serde::Deserialize)]
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct DataStorageOptions {
227 #[prost(enumeration = "AvailableDataStorages", tag = "1")]
233 pub storage: i32,
234 #[prost(string, tag = "2")]
241 pub data_dir: ::prost::alloc::string::String,
242 #[prost(string, tag = "3")]
246 pub dir_structure: ::prost::alloc::string::String,
247 #[prost(bool, tag = "4")]
249 pub force_fsync: bool,
250 #[prost(string, optional, tag = "10")]
254 pub s3_bucket: ::core::option::Option<::prost::alloc::string::String>,
255 #[prost(string, optional, tag = "11")]
259 pub s3_region: ::core::option::Option<::prost::alloc::string::String>,
260 #[prost(string, optional, tag = "12")]
264 pub s3_access_key: ::core::option::Option<::prost::alloc::string::String>,
265 #[prost(string, optional, tag = "13")]
271 pub s3_access_key_path: ::core::option::Option<::prost::alloc::string::String>,
272 #[prost(string, optional, tag = "14")]
276 pub s3_secret_key: ::core::option::Option<::prost::alloc::string::String>,
277 #[prost(string, optional, tag = "15")]
283 pub s3_secret_key_path: ::core::option::Option<::prost::alloc::string::String>,
284 #[prost(string, optional, tag = "16")]
288 pub s3_url: ::core::option::Option<::prost::alloc::string::String>,
289 #[prost(bool, tag = "17")]
293 pub s3_force_path_style: bool,
294 #[prost(string, optional, tag = "18")]
298 pub s3_security_token: ::core::option::Option<::prost::alloc::string::String>,
299 #[prost(string, optional, tag = "19")]
301 pub s3_session_token: ::core::option::Option<::prost::alloc::string::String>,
302 #[prost(string, optional, tag = "20")]
304 pub s3_profile: ::core::option::Option<::prost::alloc::string::String>,
305 #[prost(string, optional, tag = "21")]
308 pub s3_headers: ::core::option::Option<::prost::alloc::string::String>,
309 #[prost(uint32, tag = "22")]
317 pub s3_concat_concurrent_downloads: u32,
318}
319#[derive(serde::Serialize, serde::Deserialize)]
320#[derive(Clone, PartialEq, ::prost::Message)]
321pub struct InfoStoreOptions {
322 #[prost(enumeration = "AvailableInfoStorages", tag = "1")]
330 pub info_storage: i32,
331 #[prost(string, tag = "2")]
337 pub info_dir: ::prost::alloc::string::String,
338 #[prost(string, optional, tag = "3")]
345 pub info_db_dsn: ::core::option::Option<::prost::alloc::string::String>,
346 #[prost(uint64, optional, tag = "4")]
348 pub redis_info_expiration: ::core::option::Option<u64>,
349}
350#[derive(serde::Serialize, serde::Deserialize)]
351#[derive(Clone, PartialEq, ::prost::Message)]
352pub struct AmqpHooksOptions {
353 #[prost(string, optional, tag = "1")]
355 pub url: ::core::option::Option<::prost::alloc::string::String>,
356 #[prost(bool, tag = "2")]
358 pub declare_exchange: bool,
359 #[prost(bool, tag = "3")]
362 pub declare_queues: bool,
363 #[prost(bool, tag = "4")]
365 pub durable_exchange: bool,
366 #[prost(bool, tag = "5")]
368 pub durable_queues: bool,
369 #[prost(bool, tag = "6")]
371 pub celery: bool,
372 #[prost(string, tag = "10")]
376 pub exchange: ::prost::alloc::string::String,
377 #[prost(string, tag = "11")]
381 pub exchange_kind: ::prost::alloc::string::String,
382 #[prost(string, optional, tag = "12")]
384 pub routing_key: ::core::option::Option<::prost::alloc::string::String>,
385 #[prost(string, tag = "13")]
389 pub queues_prefix: ::prost::alloc::string::String,
390 #[prost(uint64, tag = "14")]
394 pub connection_pool_size: u64,
395 #[prost(uint64, tag = "15")]
399 pub channel_pool_size: u64,
400 #[prost(uint64, optional, tag = "16")]
402 pub idle_connection_timeout: ::core::option::Option<u64>,
403 #[prost(uint64, optional, tag = "17")]
405 pub idle_channels_timeout: ::core::option::Option<u64>,
406 #[prost(bool, tag = "18")]
408 pub auto_delete: bool,
409}
410#[derive(serde::Serialize, serde::Deserialize)]
411#[derive(Clone, PartialEq, ::prost::Message)]
412pub struct KafkaHookOptions {
413 #[prost(string, optional, tag = "1")]
418 pub urls: ::core::option::Option<::prost::alloc::string::String>,
419 #[prost(string, optional, tag = "2")]
421 pub client_id: ::core::option::Option<::prost::alloc::string::String>,
422 #[prost(string, optional, tag = "5")]
424 pub required_acks: ::core::option::Option<::prost::alloc::string::String>,
425 #[prost(string, optional, tag = "6")]
427 pub compression: ::core::option::Option<::prost::alloc::string::String>,
428 #[prost(uint64, optional, tag = "7")]
430 pub idle_timeout: ::core::option::Option<u64>,
431 #[prost(uint64, optional, tag = "8")]
433 pub send_timeout: ::core::option::Option<u64>,
434 #[prost(map = "string, string", tag = "20")]
437 pub extra_kafka_opts: ::std::collections::HashMap<
438 ::prost::alloc::string::String,
439 ::prost::alloc::string::String,
440 >,
441 #[prost(oneof = "kafka_hook_options::TopicOrPrefix", tags = "3, 4")]
443 pub topic_or_prefix: ::core::option::Option<kafka_hook_options::TopicOrPrefix>,
444}
445pub mod kafka_hook_options {
447 #[derive(serde::Serialize, serde::Deserialize)]
449 #[derive(Clone, PartialEq, ::prost::Oneof)]
450 pub enum TopicOrPrefix {
451 #[prost(string, tag = "3")]
452 Topic(::prost::alloc::string::String),
453 #[prost(string, tag = "4")]
454 Prefix(::prost::alloc::string::String),
455 }
456}
457#[derive(serde::Serialize, serde::Deserialize)]
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct NatsHookOptions {
460 #[prost(string, repeated, tag = "1")]
462 pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
463 #[prost(bool, tag = "4")]
465 pub wait_for_replies: bool,
466 #[prost(string, optional, tag = "10")]
468 pub username: ::core::option::Option<::prost::alloc::string::String>,
469 #[prost(string, optional, tag = "11")]
471 pub password: ::core::option::Option<::prost::alloc::string::String>,
472 #[prost(string, optional, tag = "12")]
474 pub token: ::core::option::Option<::prost::alloc::string::String>,
475 #[prost(oneof = "nats_hook_options::SubjectOrPrefix", tags = "2, 3")]
477 pub subject_or_prefix: ::core::option::Option<nats_hook_options::SubjectOrPrefix>,
478}
479pub mod nats_hook_options {
481 #[derive(serde::Serialize, serde::Deserialize)]
483 #[derive(Clone, PartialEq, ::prost::Oneof)]
484 pub enum SubjectOrPrefix {
485 #[prost(string, tag = "2")]
486 Subject(::prost::alloc::string::String),
487 #[prost(string, tag = "3")]
488 Prefix(::prost::alloc::string::String),
489 }
490}
491#[derive(serde::Serialize, serde::Deserialize)]
492#[derive(Clone, PartialEq, ::prost::Message)]
493pub struct NotificationsOptions {
494 #[prost(enumeration = "Format", tag = "1")]
500 pub hooks_format: i32,
501 #[prost(enumeration = "Hook", repeated, tag = "2")]
505 pub hooks: ::prost::alloc::vec::Vec<i32>,
506 #[prost(bool, tag = "3")]
508 pub behind_proxy: bool,
509 #[prost(string, repeated, tag = "4")]
511 pub hooks_http_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
512 #[prost(uint64, optional, tag = "5")]
514 pub http_hook_timeout: ::core::option::Option<u64>,
515 #[prost(string, repeated, tag = "6")]
517 pub hooks_http_proxy_headers: ::prost::alloc::vec::Vec<
518 ::prost::alloc::string::String,
519 >,
520 #[prost(string, optional, tag = "10")]
522 pub hooks_dir: ::core::option::Option<::prost::alloc::string::String>,
523 #[prost(string, optional, tag = "11")]
525 pub hooks_file: ::core::option::Option<::prost::alloc::string::String>,
526 #[prost(message, optional, tag = "20")]
527 pub amqp_hook_opts: ::core::option::Option<AmqpHooksOptions>,
528 #[prost(message, optional, tag = "21")]
529 pub kafka_hook_opts: ::core::option::Option<KafkaHookOptions>,
530 #[prost(message, optional, tag = "22")]
531 pub nats_hook_opts: ::core::option::Option<NatsHookOptions>,
532}
533#[derive(serde::Serialize, serde::Deserialize)]
534#[derive(Clone, PartialEq, ::prost::Message)]
535pub struct SentryOptions {
536 #[prost(string, optional, tag = "1")]
537 pub dsn: ::core::option::Option<::prost::alloc::string::String>,
538 #[prost(float, tag = "2")]
543 pub sample_rate: f32,
544}
545#[derive(serde::Serialize, serde::Deserialize)]
546#[derive(Clone, PartialEq, ::prost::Message)]
547pub struct RustusConf {
548 #[prost(string, tag = "1")]
550 pub host: ::prost::alloc::string::String,
551 #[prost(uint32, tag = "2")]
553 pub port: u32,
554 #[prost(bool, tag = "3")]
555 pub disable_health_access_log: bool,
556 #[prost(string, tag = "4")]
558 pub url: ::prost::alloc::string::String,
559 #[prost(string, repeated, tag = "10")]
561 pub cors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
562 #[prost(uint64, tag = "11")]
564 pub max_body_size: u64,
565 #[prost(string, tag = "12")]
567 pub log_level: ::prost::alloc::string::String,
568 #[prost(uint64, optional, tag = "13")]
570 pub workers: ::core::option::Option<u64>,
571 #[prost(enumeration = "Extension", repeated, tag = "14")]
573 pub tus_extensions: ::prost::alloc::vec::Vec<i32>,
574 #[prost(bool, tag = "15")]
576 pub allow_empty: bool,
577 #[prost(bool, tag = "16")]
579 pub remove_parts: bool,
580 #[prost(uint64, optional, tag = "17")]
582 pub max_file_size: ::core::option::Option<u64>,
583 #[prost(message, optional, tag = "20")]
585 pub storage_opts: ::core::option::Option<DataStorageOptions>,
586 #[prost(message, optional, tag = "21")]
587 pub info_storage_opts: ::core::option::Option<InfoStoreOptions>,
588 #[prost(message, optional, tag = "22")]
589 pub notification_opts: ::core::option::Option<NotificationsOptions>,
590 #[prost(message, optional, tag = "23")]
591 pub sentry_opts: ::core::option::Option<SentryOptions>,
592}
593#[derive(serde::Serialize, serde::Deserialize)]
594#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
595#[repr(i32)]
596pub enum AvailableDataStorages {
597 Unspecified = 0,
598 FileStorage = 1,
599 S3 = 2,
600 HybridS3 = 3,
601}
602impl AvailableDataStorages {
603 pub fn as_str_name(&self) -> &'static str {
608 match self {
609 Self::Unspecified => "AVAILABLE_DATA_STORAGES_UNSPECIFIED",
610 Self::FileStorage => "FILE_STORAGE",
611 Self::S3 => "S3",
612 Self::HybridS3 => "HYBRID_S3",
613 }
614 }
615 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
617 match value {
618 "AVAILABLE_DATA_STORAGES_UNSPECIFIED" => Some(Self::Unspecified),
619 "FILE_STORAGE" => Some(Self::FileStorage),
620 "S3" => Some(Self::S3),
621 "HYBRID_S3" => Some(Self::HybridS3),
622 _ => None,
623 }
624 }
625}
626#[derive(serde::Serialize, serde::Deserialize)]
627#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
628#[repr(i32)]
629pub enum AvailableInfoStorages {
630 Unspecified = 0,
631 Files = 1,
632 Redis = 2,
633 Postgres = 3,
634}
635impl AvailableInfoStorages {
636 pub fn as_str_name(&self) -> &'static str {
641 match self {
642 Self::Unspecified => "AVAILABLE_INFO_STORAGES_UNSPECIFIED",
643 Self::Files => "FILES",
644 Self::Redis => "REDIS",
645 Self::Postgres => "POSTGRES",
646 }
647 }
648 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
650 match value {
651 "AVAILABLE_INFO_STORAGES_UNSPECIFIED" => Some(Self::Unspecified),
652 "FILES" => Some(Self::Files),
653 "REDIS" => Some(Self::Redis),
654 "POSTGRES" => Some(Self::Postgres),
655 _ => None,
656 }
657 }
658}
659#[derive(serde::Serialize, serde::Deserialize)]
660#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
661#[repr(i32)]
662pub enum Hook {
663 Unspecified = 0,
664 PreCreate = 1,
665 PostCreate = 2,
666 PostReceive = 3,
667 PreTerminate = 4,
668 PostTerminate = 5,
669 PostFinish = 6,
670}
671impl Hook {
672 pub fn as_str_name(&self) -> &'static str {
677 match self {
678 Self::Unspecified => "HOOK_UNSPECIFIED",
679 Self::PreCreate => "PRE_CREATE",
680 Self::PostCreate => "POST_CREATE",
681 Self::PostReceive => "POST_RECEIVE",
682 Self::PreTerminate => "PRE_TERMINATE",
683 Self::PostTerminate => "POST_TERMINATE",
684 Self::PostFinish => "POST_FINISH",
685 }
686 }
687 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
689 match value {
690 "HOOK_UNSPECIFIED" => Some(Self::Unspecified),
691 "PRE_CREATE" => Some(Self::PreCreate),
692 "POST_CREATE" => Some(Self::PostCreate),
693 "POST_RECEIVE" => Some(Self::PostReceive),
694 "PRE_TERMINATE" => Some(Self::PreTerminate),
695 "POST_TERMINATE" => Some(Self::PostTerminate),
696 "POST_FINISH" => Some(Self::PostFinish),
697 _ => None,
698 }
699 }
700}
701#[derive(serde::Serialize, serde::Deserialize)]
702#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
703#[repr(i32)]
704pub enum Format {
705 Unspecified = 0,
706 Default = 1,
707 V2 = 2,
708}
709impl Format {
710 pub fn as_str_name(&self) -> &'static str {
715 match self {
716 Self::Unspecified => "FORMAT_UNSPECIFIED",
717 Self::Default => "DEFAULT",
718 Self::V2 => "V2",
719 }
720 }
721 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
723 match value {
724 "FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
725 "DEFAULT" => Some(Self::Default),
726 "V2" => Some(Self::V2),
727 _ => None,
728 }
729 }
730}
731#[derive(serde::Serialize, serde::Deserialize)]
732#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
733#[repr(i32)]
734pub enum Extension {
735 Unspecified = 0,
736 Getting = 1,
737 Creation = 2,
738 CreationWithUpload = 3,
739 CreationDeferLength = 4,
740 Termination = 5,
741 Concatenation = 6,
742 Checksum = 7,
743}
744impl Extension {
745 pub fn as_str_name(&self) -> &'static str {
750 match self {
751 Self::Unspecified => "EXTENSION_UNSPECIFIED",
752 Self::Getting => "GETTING",
753 Self::Creation => "CREATION",
754 Self::CreationWithUpload => "CREATION_WITH_UPLOAD",
755 Self::CreationDeferLength => "CREATION_DEFER_LENGTH",
756 Self::Termination => "TERMINATION",
757 Self::Concatenation => "CONCATENATION",
758 Self::Checksum => "CHECKSUM",
759 }
760 }
761 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
763 match value {
764 "EXTENSION_UNSPECIFIED" => Some(Self::Unspecified),
765 "GETTING" => Some(Self::Getting),
766 "CREATION" => Some(Self::Creation),
767 "CREATION_WITH_UPLOAD" => Some(Self::CreationWithUpload),
768 "CREATION_DEFER_LENGTH" => Some(Self::CreationDeferLength),
769 "TERMINATION" => Some(Self::Termination),
770 "CONCATENATION" => Some(Self::Concatenation),
771 "CHECKSUM" => Some(Self::Checksum),
772 _ => None,
773 }
774 }
775}