From 937b07e3df4113df8ab009ec246083e3f1ced918 Mon Sep 17 00:00:00 2001 From: devad Date: Fri, 1 Sep 2023 15:15:55 +0800 Subject: [PATCH] :sparkles: Added tenant registration and list interfaces Signed-off-by: devad Former-commit-id: 458f24c4cd1586f5eaf472d60ae0c868d9996bf7 --- .../participantservice/participantservice.go | 19 + rpc/client/pcmcore/pcmcore.go | 3 + .../participantservice/listtenantlogic.go | 38 ++ .../participantservice/registertenantlogic.go | 48 +++ .../participantserviceserver.go | 12 + rpc/pb/pcmCore.proto | 24 ++ rpc/pcmCore/pcmCore.pb.go | 405 ++++++++++++++---- rpc/pcmCore/pcmCore_grpc.pb.go | 80 +++- 8 files changed, 554 insertions(+), 75 deletions(-) create mode 100644 rpc/internal/logic/participantservice/listtenantlogic.go create mode 100644 rpc/internal/logic/participantservice/registertenantlogic.go diff --git a/rpc/client/participantservice/participantservice.go b/rpc/client/participantservice/participantservice.go index ec03abaa..f1634887 100644 --- a/rpc/client/participantservice/participantservice.go +++ b/rpc/client/participantservice/participantservice.go @@ -22,6 +22,7 @@ type ( InfoListResp = pcmCore.InfoListResp ListParticipantAvailResp = pcmCore.ListParticipantAvailResp ListParticipantPhyResp = pcmCore.ListParticipantPhyResp + ListTenantResp = pcmCore.ListTenantResp NodeAvailInfo = pcmCore.NodeAvailInfo NodePhyInfo = pcmCore.NodePhyInfo ParticipantAvailReq = pcmCore.ParticipantAvailReq @@ -35,6 +36,8 @@ type ( QueuePhyInfo = pcmCore.QueuePhyInfo SyncInfoReq = pcmCore.SyncInfoReq SyncInfoResp = pcmCore.SyncInfoResp + TenantInfo = pcmCore.TenantInfo + TenantResp = pcmCore.TenantResp ParticipantService interface { // registerParticipant Participant注册接口 @@ -49,6 +52,10 @@ type ( ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error) // listPhyInformation 集群静态信息列表 ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error) + // registerTenant 注册租户信息 + RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) + // listTenant 租户列表信息 + ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) } defaultParticipantService struct { @@ -97,3 +104,15 @@ func (m *defaultParticipantService) ListPhyInformation(ctx context.Context, in * client := pcmCore.NewParticipantServiceClient(m.cli.Conn()) return client.ListPhyInformation(ctx, in, opts...) } + +// registerTenant 注册租户信息 +func (m *defaultParticipantService) RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) { + client := pcmCore.NewParticipantServiceClient(m.cli.Conn()) + return client.RegisterTenant(ctx, in, opts...) +} + +// listTenant 租户列表信息 +func (m *defaultParticipantService) ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) { + client := pcmCore.NewParticipantServiceClient(m.cli.Conn()) + return client.ListTenant(ctx, in, opts...) +} diff --git a/rpc/client/pcmcore/pcmcore.go b/rpc/client/pcmcore/pcmcore.go index 70e9bd25..2cd455e1 100644 --- a/rpc/client/pcmcore/pcmcore.go +++ b/rpc/client/pcmcore/pcmcore.go @@ -22,6 +22,7 @@ type ( InfoListResp = pcmCore.InfoListResp ListParticipantAvailResp = pcmCore.ListParticipantAvailResp ListParticipantPhyResp = pcmCore.ListParticipantPhyResp + ListTenantResp = pcmCore.ListTenantResp NodeAvailInfo = pcmCore.NodeAvailInfo NodePhyInfo = pcmCore.NodePhyInfo ParticipantAvailReq = pcmCore.ParticipantAvailReq @@ -35,6 +36,8 @@ type ( QueuePhyInfo = pcmCore.QueuePhyInfo SyncInfoReq = pcmCore.SyncInfoReq SyncInfoResp = pcmCore.SyncInfoResp + TenantInfo = pcmCore.TenantInfo + TenantResp = pcmCore.TenantResp PcmCore interface { // SyncInfo Synchronous data information diff --git a/rpc/internal/logic/participantservice/listtenantlogic.go b/rpc/internal/logic/participantservice/listtenantlogic.go new file mode 100644 index 00000000..dc6ff5a3 --- /dev/null +++ b/rpc/internal/logic/participantservice/listtenantlogic.go @@ -0,0 +1,38 @@ +package participantservicelogic + +import ( + "context" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/model" + "gitlink.org.cn/jcce-pcm/utils/tool" + + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListTenantLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListTenantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListTenantLogic { + return &ListTenantLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// listTenant 租户列表信息 +func (l *ListTenantLogic) ListTenant(in *pcmCore.TenantInfo) (*pcmCore.ListTenantResp, error) { + resp := &pcmCore.ListTenantResp{} + var scTenantInfos []model.ScTenantInfo + //查询集群静态信息列表 + l.svcCtx.DbEngin.Find(&scTenantInfos) + tool.Convert(scTenantInfos, &resp.TenantInfos) + resp.Code = 200 + resp.Msg = "success" + return resp, nil +} diff --git a/rpc/internal/logic/participantservice/registertenantlogic.go b/rpc/internal/logic/participantservice/registertenantlogic.go new file mode 100644 index 00000000..79fb3370 --- /dev/null +++ b/rpc/internal/logic/participantservice/registertenantlogic.go @@ -0,0 +1,48 @@ +package participantservicelogic + +import ( + "context" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/model" + "gitlink.org.cn/jcce-pcm/utils/tool" + "time" + + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RegisterTenantLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewRegisterTenantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RegisterTenantLogic { + return &RegisterTenantLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// registerTenant 注册租户信息 +func (l *RegisterTenantLogic) RegisterTenant(in *pcmCore.TenantInfo) (*pcmCore.TenantResp, error) { + // todo: add your logic here and delete this line + tenantInfo := &model.ScTenantInfo{} + tool.Convert(in, tenantInfo) + tenantInfo.Id = tool.GenSnowflakeID() + tenantInfo.CreatedTime = time.Now() + tx := l.svcCtx.DbEngin.Save(&tenantInfo) + if tx.Error != nil { + logx.Errorf("orm err:", tx.Error) + return &pcmCore.TenantResp{ + Code: 500, + Msg: "save Tenant error " + tx.Error.Error(), + }, nil + } + return &pcmCore.TenantResp{ + Code: 200, + Msg: "success", + }, nil +} diff --git a/rpc/internal/server/participantservice/participantserviceserver.go b/rpc/internal/server/participantservice/participantserviceserver.go index e5e86bb3..146f010f 100644 --- a/rpc/internal/server/participantservice/participantserviceserver.go +++ b/rpc/internal/server/participantservice/participantserviceserver.go @@ -57,3 +57,15 @@ func (s *ParticipantServiceServer) ListPhyInformation(ctx context.Context, in *p l := participantservicelogic.NewListPhyInformationLogic(ctx, s.svcCtx) return l.ListPhyInformation(in) } + +// registerTenant 注册租户信息 +func (s *ParticipantServiceServer) RegisterTenant(ctx context.Context, in *pcmCore.TenantInfo) (*pcmCore.TenantResp, error) { + l := participantservicelogic.NewRegisterTenantLogic(ctx, s.svcCtx) + return l.RegisterTenant(in) +} + +// listTenant 租户列表信息 +func (s *ParticipantServiceServer) ListTenant(ctx context.Context, in *pcmCore.TenantInfo) (*pcmCore.ListTenantResp, error) { + l := participantservicelogic.NewListTenantLogic(ctx, s.svcCtx) + return l.ListTenant(in) +} diff --git a/rpc/pb/pcmCore.proto b/rpc/pb/pcmCore.proto index 165df918..dccfd57f 100644 --- a/rpc/pb/pcmCore.proto +++ b/rpc/pb/pcmCore.proto @@ -247,6 +247,24 @@ message ClientInfo { int64 lastHeartbeat = 4; // @gotags: redis:"lastHeartbeat" } +message TenantInfo { + int64 id = 1; + string tenantName = 2; + string tenantDesc = 3; +} + +message TenantResp { + int64 code = 1; + string msg = 2; + int64 id = 3; +} + +message ListTenantResp { + int64 code = 1; + string msg = 2; + repeated TenantInfo tenantInfos = 3; +} + // participant 参与者 service participantService { @@ -267,4 +285,10 @@ service participantService { // listPhyInformation 集群静态信息列表 rpc listPhyInformation(ParticipantTenant) returns (ListParticipantPhyResp) {}; + + // registerTenant 注册租户信息 + rpc registerTenant(TenantInfo) returns (TenantResp) {}; + + // listTenant 租户列表信息 + rpc listTenant(TenantInfo) returns (ListTenantResp) {}; } \ No newline at end of file diff --git a/rpc/pcmCore/pcmCore.pb.go b/rpc/pcmCore/pcmCore.pb.go index c304d00c..b5effa8e 100644 --- a/rpc/pcmCore/pcmCore.pb.go +++ b/rpc/pcmCore/pcmCore.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v3.19.4 +// protoc v4.23.4 // source: pb/pcmCore.proto package pcmCore @@ -2095,10 +2095,10 @@ type ClientInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // @gotags: redis:"address" - ParticipantId int64 `protobuf:"varint,2,opt,name=participantId,proto3" json:"participantId,omitempty"` // @gotags: redis:"participantId" - ClientState string `protobuf:"bytes,3,opt,name=clientState,proto3" json:"clientState,omitempty"` // @gotags: redis:"clientState" - LastHeartbeat int64 `protobuf:"varint,4,opt,name=lastHeartbeat,proto3" json:"lastHeartbeat,omitempty"` // @gotags: redis:"lastHeartbeat" + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" redis:"address"` + ParticipantId int64 `protobuf:"varint,2,opt,name=participantId,proto3" json:"participantId,omitempty" redis:"participantId"` + ClientState string `protobuf:"bytes,3,opt,name=clientState,proto3" json:"clientState,omitempty" redis:"clientState"` + LastHeartbeat int64 `protobuf:"varint,4,opt,name=lastHeartbeat,proto3" json:"lastHeartbeat,omitempty" redis:"lastHeartbeat"` } func (x *ClientInfo) Reset() { @@ -2161,6 +2161,195 @@ func (x *ClientInfo) GetLastHeartbeat() int64 { return 0 } +type TenantInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + TenantName string `protobuf:"bytes,2,opt,name=tenantName,proto3" json:"tenantName,omitempty"` + TenantDesc string `protobuf:"bytes,3,opt,name=tenantDesc,proto3" json:"tenantDesc,omitempty"` +} + +func (x *TenantInfo) Reset() { + *x = TenantInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TenantInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TenantInfo) ProtoMessage() {} + +func (x *TenantInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TenantInfo.ProtoReflect.Descriptor instead. +func (*TenantInfo) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{22} +} + +func (x *TenantInfo) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TenantInfo) GetTenantName() string { + if x != nil { + return x.TenantName + } + return "" +} + +func (x *TenantInfo) GetTenantDesc() string { + if x != nil { + return x.TenantDesc + } + return "" +} + +type TenantResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *TenantResp) Reset() { + *x = TenantResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TenantResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TenantResp) ProtoMessage() {} + +func (x *TenantResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TenantResp.ProtoReflect.Descriptor instead. +func (*TenantResp) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{23} +} + +func (x *TenantResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *TenantResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *TenantResp) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ListTenantResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + TenantInfos []*TenantInfo `protobuf:"bytes,3,rep,name=tenantInfos,proto3" json:"tenantInfos,omitempty"` +} + +func (x *ListTenantResp) Reset() { + *x = ListTenantResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTenantResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTenantResp) ProtoMessage() {} + +func (x *ListTenantResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTenantResp.ProtoReflect.Descriptor instead. +func (*ListTenantResp) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{24} +} + +func (x *ListTenantResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ListTenantResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *ListTenantResp) GetTenantInfos() []*TenantInfo { + if x != nil { + return x.TenantInfos + } + return nil +} + var File_pb_pcmCore_proto protoreflect.FileDescriptor var file_pb_pcmCore_proto_rawDesc = []byte{ @@ -2487,52 +2676,76 @@ var file_pb_pcmCore_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x48, - 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x2a, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, - 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x7b, 0x0a, - 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, - 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, - 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, - 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, - 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0x80, 0x04, 0x0a, 0x12, 0x70, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x50, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, - 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, - 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, - 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, - 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, - 0x72, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, - 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x50, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, - 0x1a, 0x1f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x79, 0x41, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, - 0x61, 0x6e, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, - 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x12, 0x6c, 0x69, 0x73, 0x74, - 0x50, 0x68, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, - 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x63, 0x6d, - 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0a, 0x5a, - 0x08, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0a, 0x54, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x44, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x44, 0x65, 0x73, 0x63, 0x22, 0x42, 0x0a, 0x0a, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x6d, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, + 0x73, 0x67, 0x12, 0x35, 0x0a, 0x0b, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, + 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x2a, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, + 0x49, 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x7b, + 0x0a, 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x79, 0x6e, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, + 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, + 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, + 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0xfc, 0x04, 0x0a, 0x12, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x50, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, + 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, + 0x68, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, + 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, + 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, + 0x6f, 0x72, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x41, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, + 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, + 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x79, 0x41, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, + 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x41, 0x76, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x12, 0x6c, 0x69, 0x73, + 0x74, 0x50, 0x68, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x63, + 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, + 0x0a, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x12, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x13, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0a, + 0x6c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x63, 0x6d, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, + 0x17, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x70, + 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2548,7 +2761,7 @@ func file_pb_pcmCore_proto_rawDescGZIP() []byte { } var file_pb_pcmCore_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_pb_pcmCore_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_pb_pcmCore_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_pb_pcmCore_proto_goTypes = []interface{}{ (MessageStatus)(0), // 0: pcmCore.MessageStatus (*SyncInfoReq)(nil), // 1: pcmCore.SyncInfoReq @@ -2573,6 +2786,9 @@ var file_pb_pcmCore_proto_goTypes = []interface{}{ (*ParticipantResp)(nil), // 20: pcmCore.ParticipantResp (*ParticipantServiceResp)(nil), // 21: pcmCore.ParticipantServiceResp (*ClientInfo)(nil), // 22: pcmCore.ClientInfo + (*TenantInfo)(nil), // 23: pcmCore.TenantInfo + (*TenantResp)(nil), // 24: pcmCore.TenantResp + (*ListTenantResp)(nil), // 25: pcmCore.ListTenantResp } var file_pb_pcmCore_proto_depIdxs = []int32{ 4, // 0: pcmCore.SyncInfoReq.HpcInfoList:type_name -> pcmCore.HpcInfo @@ -2589,27 +2805,32 @@ var file_pb_pcmCore_proto_depIdxs = []int32{ 18, // 11: pcmCore.ParticipantAvailReq.nodeAvailInfo:type_name -> pcmCore.NodeAvailInfo 17, // 12: pcmCore.ListParticipantAvailResp.ParticipantAvails:type_name -> pcmCore.ParticipantAvailReq 22, // 13: pcmCore.ParticipantServiceResp.data:type_name -> pcmCore.ClientInfo - 1, // 14: pcmCore.pcmCore.SyncInfo:input_type -> pcmCore.SyncInfoReq - 6, // 15: pcmCore.pcmCore.InfoList:input_type -> pcmCore.InfoListReq - 13, // 16: pcmCore.participantService.registerParticipant:input_type -> pcmCore.ParticipantPhyReq - 16, // 17: pcmCore.participantService.reportHeartbeat:input_type -> pcmCore.ParticipantHeartbeatReq - 17, // 18: pcmCore.participantService.reportAvailable:input_type -> pcmCore.ParticipantAvailReq - 8, // 19: pcmCore.participantService.listParticipant:input_type -> pcmCore.ParticipantTenant - 8, // 20: pcmCore.participantService.listPhyAvailable:input_type -> pcmCore.ParticipantTenant - 8, // 21: pcmCore.participantService.listPhyInformation:input_type -> pcmCore.ParticipantTenant - 5, // 22: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp - 7, // 23: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp - 11, // 24: pcmCore.participantService.registerParticipant:output_type -> pcmCore.ParticipantPhyResp - 10, // 25: pcmCore.participantService.reportHeartbeat:output_type -> pcmCore.HealthCheckResp - 20, // 26: pcmCore.participantService.reportAvailable:output_type -> pcmCore.ParticipantResp - 21, // 27: pcmCore.participantService.listParticipant:output_type -> pcmCore.ParticipantServiceResp - 19, // 28: pcmCore.participantService.listPhyAvailable:output_type -> pcmCore.ListParticipantAvailResp - 12, // 29: pcmCore.participantService.listPhyInformation:output_type -> pcmCore.ListParticipantPhyResp - 22, // [22:30] is the sub-list for method output_type - 14, // [14:22] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 23, // 14: pcmCore.ListTenantResp.tenantInfos:type_name -> pcmCore.TenantInfo + 1, // 15: pcmCore.pcmCore.SyncInfo:input_type -> pcmCore.SyncInfoReq + 6, // 16: pcmCore.pcmCore.InfoList:input_type -> pcmCore.InfoListReq + 13, // 17: pcmCore.participantService.registerParticipant:input_type -> pcmCore.ParticipantPhyReq + 16, // 18: pcmCore.participantService.reportHeartbeat:input_type -> pcmCore.ParticipantHeartbeatReq + 17, // 19: pcmCore.participantService.reportAvailable:input_type -> pcmCore.ParticipantAvailReq + 8, // 20: pcmCore.participantService.listParticipant:input_type -> pcmCore.ParticipantTenant + 8, // 21: pcmCore.participantService.listPhyAvailable:input_type -> pcmCore.ParticipantTenant + 8, // 22: pcmCore.participantService.listPhyInformation:input_type -> pcmCore.ParticipantTenant + 23, // 23: pcmCore.participantService.registerTenant:input_type -> pcmCore.TenantInfo + 23, // 24: pcmCore.participantService.listTenant:input_type -> pcmCore.TenantInfo + 5, // 25: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp + 7, // 26: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp + 11, // 27: pcmCore.participantService.registerParticipant:output_type -> pcmCore.ParticipantPhyResp + 10, // 28: pcmCore.participantService.reportHeartbeat:output_type -> pcmCore.HealthCheckResp + 20, // 29: pcmCore.participantService.reportAvailable:output_type -> pcmCore.ParticipantResp + 21, // 30: pcmCore.participantService.listParticipant:output_type -> pcmCore.ParticipantServiceResp + 19, // 31: pcmCore.participantService.listPhyAvailable:output_type -> pcmCore.ListParticipantAvailResp + 12, // 32: pcmCore.participantService.listPhyInformation:output_type -> pcmCore.ListParticipantPhyResp + 24, // 33: pcmCore.participantService.registerTenant:output_type -> pcmCore.TenantResp + 25, // 34: pcmCore.participantService.listTenant:output_type -> pcmCore.ListTenantResp + 25, // [25:35] is the sub-list for method output_type + 15, // [15:25] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_pb_pcmCore_proto_init() } @@ -2882,6 +3103,42 @@ func file_pb_pcmCore_proto_init() { return nil } } + file_pb_pcmCore_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TenantInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TenantResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTenantResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2889,7 +3146,7 @@ func file_pb_pcmCore_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pb_pcmCore_proto_rawDesc, NumEnums: 1, - NumMessages: 22, + NumMessages: 25, NumExtensions: 0, NumServices: 2, }, diff --git a/rpc/pcmCore/pcmCore_grpc.pb.go b/rpc/pcmCore/pcmCore_grpc.pb.go index 3659c9e1..85c879a2 100644 --- a/rpc/pcmCore/pcmCore_grpc.pb.go +++ b/rpc/pcmCore/pcmCore_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.19.4 +// - protoc v4.23.4 // source: pb/pcmCore.proto package pcmCore @@ -156,6 +156,8 @@ const ( ParticipantService_ListParticipant_FullMethodName = "/pcmCore.participantService/listParticipant" ParticipantService_ListPhyAvailable_FullMethodName = "/pcmCore.participantService/listPhyAvailable" ParticipantService_ListPhyInformation_FullMethodName = "/pcmCore.participantService/listPhyInformation" + ParticipantService_RegisterTenant_FullMethodName = "/pcmCore.participantService/registerTenant" + ParticipantService_ListTenant_FullMethodName = "/pcmCore.participantService/listTenant" ) // ParticipantServiceClient is the client API for ParticipantService service. @@ -174,6 +176,10 @@ type ParticipantServiceClient interface { ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error) // listPhyInformation 集群静态信息列表 ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error) + // registerTenant 注册租户信息 + RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) + // listTenant 租户列表信息 + ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) } type participantServiceClient struct { @@ -238,6 +244,24 @@ func (c *participantServiceClient) ListPhyInformation(ctx context.Context, in *P return out, nil } +func (c *participantServiceClient) RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) { + out := new(TenantResp) + err := c.cc.Invoke(ctx, ParticipantService_RegisterTenant_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *participantServiceClient) ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) { + out := new(ListTenantResp) + err := c.cc.Invoke(ctx, ParticipantService_ListTenant_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ParticipantServiceServer is the server API for ParticipantService service. // All implementations must embed UnimplementedParticipantServiceServer // for forward compatibility @@ -254,6 +278,10 @@ type ParticipantServiceServer interface { ListPhyAvailable(context.Context, *ParticipantTenant) (*ListParticipantAvailResp, error) // listPhyInformation 集群静态信息列表 ListPhyInformation(context.Context, *ParticipantTenant) (*ListParticipantPhyResp, error) + // registerTenant 注册租户信息 + RegisterTenant(context.Context, *TenantInfo) (*TenantResp, error) + // listTenant 租户列表信息 + ListTenant(context.Context, *TenantInfo) (*ListTenantResp, error) mustEmbedUnimplementedParticipantServiceServer() } @@ -279,6 +307,12 @@ func (UnimplementedParticipantServiceServer) ListPhyAvailable(context.Context, * func (UnimplementedParticipantServiceServer) ListPhyInformation(context.Context, *ParticipantTenant) (*ListParticipantPhyResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListPhyInformation not implemented") } +func (UnimplementedParticipantServiceServer) RegisterTenant(context.Context, *TenantInfo) (*TenantResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterTenant not implemented") +} +func (UnimplementedParticipantServiceServer) ListTenant(context.Context, *TenantInfo) (*ListTenantResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTenant not implemented") +} func (UnimplementedParticipantServiceServer) mustEmbedUnimplementedParticipantServiceServer() {} // UnsafeParticipantServiceServer may be embedded to opt out of forward compatibility for this service. @@ -400,6 +434,42 @@ func _ParticipantService_ListPhyInformation_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } +func _ParticipantService_RegisterTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TenantInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ParticipantServiceServer).RegisterTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ParticipantService_RegisterTenant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ParticipantServiceServer).RegisterTenant(ctx, req.(*TenantInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _ParticipantService_ListTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TenantInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ParticipantServiceServer).ListTenant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ParticipantService_ListTenant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ParticipantServiceServer).ListTenant(ctx, req.(*TenantInfo)) + } + return interceptor(ctx, in, info, handler) +} + // ParticipantService_ServiceDesc is the grpc.ServiceDesc for ParticipantService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -431,6 +501,14 @@ var ParticipantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "listPhyInformation", Handler: _ParticipantService_ListPhyInformation_Handler, }, + { + MethodName: "registerTenant", + Handler: _ParticipantService_RegisterTenant_Handler, + }, + { + MethodName: "listTenant", + Handler: _ParticipantService_ListTenant_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/pcmCore.proto",