mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 23:56:53 +00:00
multiplex channel && rpc service add authentication
Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
+12
-3
@@ -32,7 +32,7 @@ use tokio::{
|
||||
sync::mpsc::{self, Sender},
|
||||
};
|
||||
use tokio_stream::wrappers::ReceiverStream;
|
||||
use tonic::{transport::Channel, Streaming};
|
||||
use tonic::{service::interceptor::InterceptedService, transport::Channel, Request, Status, Streaming};
|
||||
use tracing::info;
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -365,7 +365,9 @@ impl RemoteFileWriter {
|
||||
volume: String,
|
||||
path: String,
|
||||
is_append: bool,
|
||||
mut client: NodeServiceClient<Channel>,
|
||||
mut client: NodeServiceClient<
|
||||
InterceptedService<Channel, Box<dyn Fn(Request<()>) -> Result<Request<()>, Status> + Send + Sync + 'static>>,
|
||||
>,
|
||||
) -> Result<Self> {
|
||||
let (tx, rx) = mpsc::channel(128);
|
||||
let in_stream = ReceiverStream::new(rx);
|
||||
@@ -480,7 +482,14 @@ pub struct RemoteFileReader {
|
||||
}
|
||||
|
||||
impl RemoteFileReader {
|
||||
pub async fn new(root: PathBuf, volume: String, path: String, mut client: NodeServiceClient<Channel>) -> Result<Self> {
|
||||
pub async fn new(
|
||||
root: PathBuf,
|
||||
volume: String,
|
||||
path: String,
|
||||
mut client: NodeServiceClient<
|
||||
InterceptedService<Channel, Box<dyn Fn(Request<()>) -> Result<Request<()>, Status> + Send + Sync + 'static>>,
|
||||
>,
|
||||
) -> Result<Self> {
|
||||
let (tx, rx) = mpsc::channel(128);
|
||||
let in_stream = ReceiverStream::new(rx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user