feat: optimizing dependency services including grpc, api

This commit is contained in:
Marvin Zhang
2024-11-04 17:45:34 +08:00
parent c341089dce
commit fbf8e5f9f3
8 changed files with 151 additions and 102 deletions

View File

@@ -313,17 +313,19 @@ func (x *DependencyServiceSyncRequest) GetDependencies() []*Dependency {
return nil
}
type DependencyServiceUpdateTaskLogRequest struct {
type DependencyServiceUpdateLogsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
LogLines []string `protobuf:"bytes,2,rep,name=log_lines,json=logLines,proto3" json:"log_lines,omitempty"`
NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"`
Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Logs []string `protobuf:"bytes,4,rep,name=logs,proto3" json:"logs,omitempty"`
}
func (x *DependencyServiceUpdateTaskLogRequest) Reset() {
*x = DependencyServiceUpdateTaskLogRequest{}
func (x *DependencyServiceUpdateLogsRequest) Reset() {
*x = DependencyServiceUpdateLogsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_services_dependency_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -331,13 +333,13 @@ func (x *DependencyServiceUpdateTaskLogRequest) Reset() {
}
}
func (x *DependencyServiceUpdateTaskLogRequest) String() string {
func (x *DependencyServiceUpdateLogsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DependencyServiceUpdateTaskLogRequest) ProtoMessage() {}
func (*DependencyServiceUpdateLogsRequest) ProtoMessage() {}
func (x *DependencyServiceUpdateTaskLogRequest) ProtoReflect() protoreflect.Message {
func (x *DependencyServiceUpdateLogsRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_dependency_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -349,21 +351,35 @@ func (x *DependencyServiceUpdateTaskLogRequest) ProtoReflect() protoreflect.Mess
return mi.MessageOf(x)
}
// Deprecated: Use DependencyServiceUpdateTaskLogRequest.ProtoReflect.Descriptor instead.
func (*DependencyServiceUpdateTaskLogRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use DependencyServiceUpdateLogsRequest.ProtoReflect.Descriptor instead.
func (*DependencyServiceUpdateLogsRequest) Descriptor() ([]byte, []int) {
return file_services_dependency_service_proto_rawDescGZIP(), []int{4}
}
func (x *DependencyServiceUpdateTaskLogRequest) GetTaskId() string {
func (x *DependencyServiceUpdateLogsRequest) GetNodeKey() string {
if x != nil {
return x.TaskId
return x.NodeKey
}
return ""
}
func (x *DependencyServiceUpdateTaskLogRequest) GetLogLines() []string {
func (x *DependencyServiceUpdateLogsRequest) GetLang() string {
if x != nil {
return x.LogLines
return x.Lang
}
return ""
}
func (x *DependencyServiceUpdateLogsRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DependencyServiceUpdateLogsRequest) GetLogs() []string {
if x != nil {
return x.Logs
}
return nil
}
@@ -404,34 +420,35 @@ var file_services_dependency_service_proto_rawDesc = []byte{
0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63,
0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22,
0x5d, 0x0a, 0x25, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f,
0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x2a, 0x3d,
0x0a, 0x15, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x59, 0x4e, 0x43, 0x10,
0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0d,
0x0a, 0x09, 0x55, 0x4e, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x32, 0x81, 0x02,
0x0a, 0x11, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x25,
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70,
0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30,
0x01, 0x12, 0x3c, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
0x50, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67,
0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,
0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54,
0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28,
0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x7b, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79,
0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6c, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73,
0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x2a, 0x3d, 0x0a, 0x15,
0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x00, 0x12,
0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09,
0x55, 0x4e, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x32, 0xfb, 0x01, 0x0a, 0x11,
0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x5c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x67,
0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e,
0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12,
0x3c, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44,
0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a,
0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67,
0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -449,13 +466,13 @@ func file_services_dependency_service_proto_rawDescGZIP() []byte {
var file_services_dependency_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_services_dependency_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_services_dependency_service_proto_goTypes = []any{
(DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode
(*Dependency)(nil), // 1: grpc.Dependency
(*DependencyServiceConnectRequest)(nil), // 2: grpc.DependencyServiceConnectRequest
(*DependencyServiceConnectResponse)(nil), // 3: grpc.DependencyServiceConnectResponse
(*DependencyServiceSyncRequest)(nil), // 4: grpc.DependencyServiceSyncRequest
(*DependencyServiceUpdateTaskLogRequest)(nil), // 5: grpc.DependencyServiceUpdateTaskLogRequest
(*Response)(nil), // 6: grpc.Response
(DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode
(*Dependency)(nil), // 1: grpc.Dependency
(*DependencyServiceConnectRequest)(nil), // 2: grpc.DependencyServiceConnectRequest
(*DependencyServiceConnectResponse)(nil), // 3: grpc.DependencyServiceConnectResponse
(*DependencyServiceSyncRequest)(nil), // 4: grpc.DependencyServiceSyncRequest
(*DependencyServiceUpdateLogsRequest)(nil), // 5: grpc.DependencyServiceUpdateLogsRequest
(*Response)(nil), // 6: grpc.Response
}
var file_services_dependency_service_proto_depIdxs = []int32{
0, // 0: grpc.DependencyServiceConnectResponse.code:type_name -> grpc.DependencyServiceCode
@@ -463,10 +480,10 @@ var file_services_dependency_service_proto_depIdxs = []int32{
1, // 2: grpc.DependencyServiceSyncRequest.dependencies:type_name -> grpc.Dependency
2, // 3: grpc.DependencyService.Connect:input_type -> grpc.DependencyServiceConnectRequest
4, // 4: grpc.DependencyService.Sync:input_type -> grpc.DependencyServiceSyncRequest
5, // 5: grpc.DependencyService.UpdateTaskLog:input_type -> grpc.DependencyServiceUpdateTaskLogRequest
5, // 5: grpc.DependencyService.UpdateLogs:input_type -> grpc.DependencyServiceUpdateLogsRequest
3, // 6: grpc.DependencyService.Connect:output_type -> grpc.DependencyServiceConnectResponse
6, // 7: grpc.DependencyService.Sync:output_type -> grpc.Response
6, // 8: grpc.DependencyService.UpdateTaskLog:output_type -> grpc.Response
6, // 8: grpc.DependencyService.UpdateLogs:output_type -> grpc.Response
6, // [6:9] is the sub-list for method output_type
3, // [3:6] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
@@ -530,7 +547,7 @@ func file_services_dependency_service_proto_init() {
}
}
file_services_dependency_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*DependencyServiceUpdateTaskLogRequest); i {
switch v := v.(*DependencyServiceUpdateLogsRequest); i {
case 0:
return &v.state
case 1:

View File

@@ -19,9 +19,9 @@ import (
const _ = grpc.SupportPackageIsVersion8
const (
DependencyService_Connect_FullMethodName = "/grpc.DependencyService/Connect"
DependencyService_Sync_FullMethodName = "/grpc.DependencyService/Sync"
DependencyService_UpdateTaskLog_FullMethodName = "/grpc.DependencyService/UpdateTaskLog"
DependencyService_Connect_FullMethodName = "/grpc.DependencyService/Connect"
DependencyService_Sync_FullMethodName = "/grpc.DependencyService/Sync"
DependencyService_UpdateLogs_FullMethodName = "/grpc.DependencyService/UpdateLogs"
)
// DependencyServiceClient is the client API for DependencyService service.
@@ -30,7 +30,7 @@ const (
type DependencyServiceClient interface {
Connect(ctx context.Context, in *DependencyServiceConnectRequest, opts ...grpc.CallOption) (DependencyService_ConnectClient, error)
Sync(ctx context.Context, in *DependencyServiceSyncRequest, opts ...grpc.CallOption) (*Response, error)
UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateTaskLogClient, error)
UpdateLogs(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateLogsClient, error)
}
type dependencyServiceClient struct {
@@ -84,31 +84,31 @@ func (c *dependencyServiceClient) Sync(ctx context.Context, in *DependencyServic
return out, nil
}
func (c *dependencyServiceClient) UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateTaskLogClient, error) {
func (c *dependencyServiceClient) UpdateLogs(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateLogsClient, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &DependencyService_ServiceDesc.Streams[1], DependencyService_UpdateTaskLog_FullMethodName, cOpts...)
stream, err := c.cc.NewStream(ctx, &DependencyService_ServiceDesc.Streams[1], DependencyService_UpdateLogs_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &dependencyServiceUpdateTaskLogClient{ClientStream: stream}
x := &dependencyServiceUpdateLogsClient{ClientStream: stream}
return x, nil
}
type DependencyService_UpdateTaskLogClient interface {
Send(*DependencyServiceUpdateTaskLogRequest) error
type DependencyService_UpdateLogsClient interface {
Send(*DependencyServiceUpdateLogsRequest) error
CloseAndRecv() (*Response, error)
grpc.ClientStream
}
type dependencyServiceUpdateTaskLogClient struct {
type dependencyServiceUpdateLogsClient struct {
grpc.ClientStream
}
func (x *dependencyServiceUpdateTaskLogClient) Send(m *DependencyServiceUpdateTaskLogRequest) error {
func (x *dependencyServiceUpdateLogsClient) Send(m *DependencyServiceUpdateLogsRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *dependencyServiceUpdateTaskLogClient) CloseAndRecv() (*Response, error) {
func (x *dependencyServiceUpdateLogsClient) CloseAndRecv() (*Response, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
@@ -125,7 +125,7 @@ func (x *dependencyServiceUpdateTaskLogClient) CloseAndRecv() (*Response, error)
type DependencyServiceServer interface {
Connect(*DependencyServiceConnectRequest, DependencyService_ConnectServer) error
Sync(context.Context, *DependencyServiceSyncRequest) (*Response, error)
UpdateTaskLog(DependencyService_UpdateTaskLogServer) error
UpdateLogs(DependencyService_UpdateLogsServer) error
mustEmbedUnimplementedDependencyServiceServer()
}
@@ -139,8 +139,8 @@ func (UnimplementedDependencyServiceServer) Connect(*DependencyServiceConnectReq
func (UnimplementedDependencyServiceServer) Sync(context.Context, *DependencyServiceSyncRequest) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
func (UnimplementedDependencyServiceServer) UpdateTaskLog(DependencyService_UpdateTaskLogServer) error {
return status.Errorf(codes.Unimplemented, "method UpdateTaskLog not implemented")
func (UnimplementedDependencyServiceServer) UpdateLogs(DependencyService_UpdateLogsServer) error {
return status.Errorf(codes.Unimplemented, "method UpdateLogs not implemented")
}
func (UnimplementedDependencyServiceServer) mustEmbedUnimplementedDependencyServiceServer() {}
@@ -194,26 +194,26 @@ func _DependencyService_Sync_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _DependencyService_UpdateTaskLog_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(DependencyServiceServer).UpdateTaskLog(&dependencyServiceUpdateTaskLogServer{ServerStream: stream})
func _DependencyService_UpdateLogs_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(DependencyServiceServer).UpdateLogs(&dependencyServiceUpdateLogsServer{ServerStream: stream})
}
type DependencyService_UpdateTaskLogServer interface {
type DependencyService_UpdateLogsServer interface {
SendAndClose(*Response) error
Recv() (*DependencyServiceUpdateTaskLogRequest, error)
Recv() (*DependencyServiceUpdateLogsRequest, error)
grpc.ServerStream
}
type dependencyServiceUpdateTaskLogServer struct {
type dependencyServiceUpdateLogsServer struct {
grpc.ServerStream
}
func (x *dependencyServiceUpdateTaskLogServer) SendAndClose(m *Response) error {
func (x *dependencyServiceUpdateLogsServer) SendAndClose(m *Response) error {
return x.ServerStream.SendMsg(m)
}
func (x *dependencyServiceUpdateTaskLogServer) Recv() (*DependencyServiceUpdateTaskLogRequest, error) {
m := new(DependencyServiceUpdateTaskLogRequest)
func (x *dependencyServiceUpdateLogsServer) Recv() (*DependencyServiceUpdateLogsRequest, error) {
m := new(DependencyServiceUpdateLogsRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
@@ -239,8 +239,8 @@ var DependencyService_ServiceDesc = grpc.ServiceDesc{
ServerStreams: true,
},
{
StreamName: "UpdateTaskLog",
Handler: _DependencyService_UpdateTaskLog_Handler,
StreamName: "UpdateLogs",
Handler: _DependencyService_UpdateLogs_Handler,
ClientStreams: true,
},
},

View File

@@ -34,13 +34,15 @@ message DependencyServiceSyncRequest {
repeated Dependency dependencies = 3;
}
message DependencyServiceUpdateTaskLogRequest {
string task_id = 1;
repeated string log_lines = 2;
message DependencyServiceUpdateLogsRequest {
string node_key = 1;
string lang = 2;
string name = 3;
repeated string logs = 4;
}
service DependencyService {
rpc Connect(DependencyServiceConnectRequest) returns (stream DependencyServiceConnectResponse){};
rpc Sync(DependencyServiceSyncRequest) returns (Response){};
rpc UpdateTaskLog(stream DependencyServiceUpdateTaskLogRequest) returns (Response){};
rpc UpdateLogs(stream DependencyServiceUpdateLogsRequest) returns (Response){};
}