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:
zhenyi
2026-06-10 18:49:42 +08:00
parent 9eb77ab98b
commit 1000f8a80d
57 changed files with 22524 additions and 2703 deletions
+5
View File
@@ -0,0 +1,5 @@
// Generated from proto/this/*.proto (package appks.v1)
// Compiled via tonic-build in build.rs using OUT_DIR + include!
// Build server = true, build client = false (appks is the server side).
include!(concat!(env!("OUT_DIR"), "/appks.v1.rs"));
+5
View File
@@ -0,0 +1,5 @@
// Generated from proto/this/im/*.proto (package appks.im.v1)
// Compiled via tonic-build in build.rs using OUT_DIR + include!
// Build server = true, build client = false (appks is the server side for IM RPCs).
include!(concat!(env!("OUT_DIR"), "/appks.im.v1.rs"));
+49 -1
View File
@@ -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.