chore(infra): add gRPC layer, update protobufs, remove immediate module
- Add gRPC service modules: auth, channel, channel settings, member, permission - Update protobuf definitions and generated code - Remove immediate/ real-time module (superseded by IM service) - Update etcd discovery and registration - Update cache, error, config, and build infrastructure - Add ADR documentation - Update OpenAPI spec
This commit is contained in:
@@ -1,8 +1,37 @@
|
||||
pub mod appks;
|
||||
pub mod email;
|
||||
pub mod im;
|
||||
pub mod repo;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tonic::transport::{Channel, Endpoint};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Hash, prost::Message, Serialize, Deserialize, utoipa::ToSchema)]
|
||||
pub struct Timestamp {
|
||||
#[prost(int64, tag = "1")]
|
||||
pub seconds: i64,
|
||||
#[prost(int32, tag = "2")]
|
||||
pub nanos: i32,
|
||||
}
|
||||
|
||||
impl From<prost_types::Timestamp> for Timestamp {
|
||||
fn from(t: prost_types::Timestamp) -> Self {
|
||||
Self {
|
||||
seconds: t.seconds,
|
||||
nanos: t.nanos,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Timestamp> for prost_types::Timestamp {
|
||||
fn from(t: Timestamp) -> Self {
|
||||
Self {
|
||||
seconds: t.seconds,
|
||||
nanos: t.nanos,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct RepoClient {
|
||||
pub repository: repo::repository_service_client::RepositoryServiceClient<Channel>,
|
||||
@@ -15,6 +44,8 @@ pub struct RepoClient {
|
||||
pub blame: repo::blame_service_client::BlameServiceClient<Channel>,
|
||||
pub archive: repo::archive_service_client::ArchiveServiceClient<Channel>,
|
||||
pub pack: repo::pack_service_client::PackServiceClient<Channel>,
|
||||
pub ref_: repo::ref_service_client::RefServiceClient<Channel>,
|
||||
pub remote: repo::remote_service_client::RemoteServiceClient<Channel>,
|
||||
}
|
||||
|
||||
impl RepoClient {
|
||||
@@ -41,7 +72,9 @@ impl RepoClient {
|
||||
merge: repo::merge_service_client::MergeServiceClient::new(channel.clone()),
|
||||
blame: repo::blame_service_client::BlameServiceClient::new(channel.clone()),
|
||||
archive: repo::archive_service_client::ArchiveServiceClient::new(channel.clone()),
|
||||
pack: repo::pack_service_client::PackServiceClient::new(channel),
|
||||
pack: repo::pack_service_client::PackServiceClient::new(channel.clone()),
|
||||
ref_: repo::ref_service_client::RefServiceClient::new(channel.clone()),
|
||||
remote: repo::remote_service_client::RemoteServiceClient::new(channel),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,3 +115,18 @@ impl std::ops::DerefMut for EmailClient {
|
||||
&mut self.inner
|
||||
}
|
||||
}
|
||||
|
||||
// Section: Appks gRPC server traits
|
||||
//
|
||||
// Core services (package appks.v1) live in pb::appks::
|
||||
// - RepoService
|
||||
//
|
||||
// IM services (package appks.im.v1) live in pb::im::
|
||||
// - ChannelService, MemberService, PermissionService
|
||||
// - InternalAuthService
|
||||
// - ChannelRoleService, ChannelInvitationService, ChannelWebhookService
|
||||
// - ChannelSlashCommandService, ChannelRepoLinkService, ImIntegrationService
|
||||
// - CustomEmojiService, ForumTagService, VoiceService, StageService
|
||||
// - ChannelAuditService
|
||||
//
|
||||
// Implementations are in grpc/ and wired into the tonic server in grpc/mod.rs.
|
||||
|
||||
Reference in New Issue
Block a user