-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement prototype of agent grpc server
- Loading branch information
Showing
13 changed files
with
460 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
mod common; | ||
mod index; | ||
mod insert; | ||
mod remove; | ||
mod search; | ||
mod update; | ||
mod upsert; | ||
|
||
#[derive(Default, Debug)] | ||
pub struct Agent { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#[macro_export] | ||
macro_rules! stream_type { | ||
($t:ty) => { | ||
std::pin::Pin<Box<dyn tokio_stream::Stream<Item = std::result::Result<$t, tonic::Status>> + Send>> | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use proto::{ | ||
core::v1::agent_server, | ||
payload::v1::{control, info, object, Empty}, | ||
}; | ||
|
||
#[tonic::async_trait] | ||
impl agent_server::Agent for super::Agent { | ||
async fn create_index( | ||
&self, | ||
request: tonic::Request<control::CreateIndexRequest>, | ||
) -> std::result::Result<tonic::Response<Empty>, tonic::Status> { | ||
todo!() | ||
} | ||
|
||
async fn save_index( | ||
&self, | ||
request: tonic::Request<Empty>, | ||
) -> std::result::Result<tonic::Response<Empty>, tonic::Status> { | ||
todo!() | ||
} | ||
|
||
#[doc = " Represent the creating and saving index RPC.\n"] | ||
async fn create_and_save_index( | ||
&self, | ||
request: tonic::Request<control::CreateIndexRequest>, | ||
) -> std::result::Result<tonic::Response<Empty>, tonic::Status> { | ||
todo!() | ||
} | ||
|
||
#[doc = " Represent the RPC to get the agent index information.\n"] | ||
async fn index_info( | ||
&self, | ||
request: tonic::Request<Empty>, | ||
) -> std::result::Result<tonic::Response<info::index::Count>, tonic::Status> { | ||
todo!() | ||
} | ||
|
||
#[doc = " Represent the RPC to get the vector metadata. This RPC is mainly used for index correction process\n"] | ||
async fn get_timestamp( | ||
&self, | ||
request: tonic::Request<object::GetTimestampRequest>, | ||
) -> std::result::Result<tonic::Response<object::Timestamp>, tonic::Status> { | ||
todo!() | ||
} | ||
} |
Oops, something went wrong.