diff --git a/gen/openapi/sync/v1/group.swagger.json b/gen/openapi/sync/v1/group.swagger.json new file mode 100644 index 0000000..cc73b77 --- /dev/null +++ b/gen/openapi/sync/v1/group.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "sync/v1/group.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/gen/openapi/sync/v1/sync_service.swagger.json b/gen/openapi/sync/v1/sync_service.swagger.json index 8e4573b..7e1adfb 100644 --- a/gen/openapi/sync/v1/sync_service.swagger.json +++ b/gen/openapi/sync/v1/sync_service.swagger.json @@ -55,15 +55,15 @@ ] } }, - "/gapi/sync/v1/update": { - "post": { - "summary": "提交最新配置 若配置的ID为空,则创建新配置。若配置的删除时间不为空,则代表该配置已被删除。", - "operationId": "SyncService_Update", + "/gapi/sync/v1/sync_group": { + "get": { + "summary": "通过UID获取所有组信息", + "operationId": "SyncService_SyncGroup", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateResponse" + "$ref": "#/definitions/v1SyncGroupResponse" } }, "default": { @@ -75,262 +75,77 @@ }, "parameters": [ { - "name": "host.id", - "description": "内部唯一ID ulid", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.createdAt", - "description": "创建时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "host.updatedAt", - "description": "更新时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "host.deletedAt", - "description": "删除时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "host.label", - "description": "标签", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.tags", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" - }, - { - "name": "host.address", - "description": "ip或host", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.port", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "host.charset", - "description": "字符集", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.username", - "description": "用户名", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.password", - "description": "密码", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.keyId", - "description": "密钥ID", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "host.identityId", - "description": "身份ID 若身份ID不为空,则覆盖手动配置", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "knownHost.id", - "description": "内部唯一ID ulid", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "knownHost.createdAt", - "description": "创建时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "knownHost.updatedAt", - "description": "更新时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "knownHost.deletedAt", - "description": "删除时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "knownHost.address", - "description": "ip或host", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "knownHost.publicKey", - "description": "公钥", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sshKey.id", - "description": "内部唯一ID ulid", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sshKey.createdAt", - "description": "创建时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "sshKey.updatedAt", - "description": "更新时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "sshKey.deletedAt", - "description": "删除时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "sshKey.label", - "description": "标签", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sshKey.privateKey", - "description": "私钥", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sshKey.publicKey", - "description": "公钥", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sshKey.certificate", - "description": "证书", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "identity.id", - "description": "内部唯一ID ulid", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "identity.createdAt", - "description": "创建时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "identity.updatedAt", - "description": "更新时间", - "in": "query", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "identity.deletedAt", - "description": "删除时间", + "name": "after", "in": "query", "required": false, "type": "string", "format": "date-time" + } + ], + "tags": [ + "SyncService" + ] + } + }, + "/gapi/sync/v1/update": { + "post": { + "summary": "提交最新配置 若配置的ID为空,则创建新配置。若配置的删除时间不为空,则代表该配置已被删除。", + "operationId": "SyncService_Update", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateResponse" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ { - "name": "identity.label", - "description": "标签", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "identity.username", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "identity.password", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateRequest" + } + } + ], + "tags": [ + "SyncService" + ] + } + }, + "/gapi/sync/v1/update_group": { + "post": { + "summary": "更新组信息", + "operationId": "SyncService_UpdateGroup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateGroupResponse" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ { - "name": "identity.keyId", - "description": "密钥ID", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateGroupRequest" + } } ], "tags": [ @@ -368,6 +183,53 @@ } } }, + "v1Group": { + "type": "object", + "properties": { + "groupBasic": { + "$ref": "#/definitions/v1GroupBasic" + }, + "memberId": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1GroupBasic": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "deletedAt": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "uid": { + "type": "string", + "title": "创建者" + } + } + }, "v1Host": { "type": "object", "properties": { @@ -542,6 +404,22 @@ }, "title": "SSH 密钥" }, + "v1SyncGroupResponse": { + "type": "object", + "properties": { + "serverTime": { + "type": "string", + "format": "date-time" + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Group" + } + } + } + }, "v1SyncResponse": { "type": "object", "properties": { @@ -580,6 +458,34 @@ } } }, + "v1UpdateGroupRequest": { + "type": "object", + "properties": { + "group": { + "$ref": "#/definitions/v1Group" + } + } + }, + "v1UpdateGroupResponse": { + "type": "object" + }, + "v1UpdateRequest": { + "type": "object", + "properties": { + "host": { + "$ref": "#/definitions/v1Host" + }, + "knownHost": { + "$ref": "#/definitions/v1KnownHost" + }, + "sshKey": { + "$ref": "#/definitions/v1SshKey" + }, + "identity": { + "$ref": "#/definitions/v1Identity" + } + } + }, "v1UpdateResponse": { "type": "object", "properties": { diff --git a/gen/proto/sync/v1/group.pb.go b/gen/proto/sync/v1/group.pb.go new file mode 100644 index 0000000..459d2b1 --- /dev/null +++ b/gen/proto/sync/v1/group.pb.go @@ -0,0 +1,300 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: sync/v1/group.proto + +package syncV1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Group struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupBasic *GroupBasic `protobuf:"bytes,1,opt,name=group_basic,json=groupBasic,proto3" json:"group_basic,omitempty"` + MemberId []string `protobuf:"bytes,2,rep,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` +} + +func (x *Group) Reset() { + *x = Group{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_group_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Group) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Group) ProtoMessage() {} + +func (x *Group) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_group_proto_msgTypes[0] + 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 Group.ProtoReflect.Descriptor instead. +func (*Group) Descriptor() ([]byte, []int) { + return file_sync_v1_group_proto_rawDescGZIP(), []int{0} +} + +func (x *Group) GetGroupBasic() *GroupBasic { + if x != nil { + return x.GroupBasic + } + return nil +} + +func (x *Group) GetMemberId() []string { + if x != nil { + return x.MemberId + } + return nil +} + +type GroupBasic struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + DeletedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + Avatar string `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar,omitempty"` + Uid string `protobuf:"bytes,8,opt,name=uid,proto3" json:"uid,omitempty"` // 创建者 +} + +func (x *GroupBasic) Reset() { + *x = GroupBasic{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_group_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupBasic) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupBasic) ProtoMessage() {} + +func (x *GroupBasic) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_group_proto_msgTypes[1] + 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 GroupBasic.ProtoReflect.Descriptor instead. +func (*GroupBasic) Descriptor() ([]byte, []int) { + return file_sync_v1_group_proto_rawDescGZIP(), []int{1} +} + +func (x *GroupBasic) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GroupBasic) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *GroupBasic) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *GroupBasic) GetDeletedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + +func (x *GroupBasic) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GroupBasic) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *GroupBasic) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *GroupBasic) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +var File_sync_v1_group_proto protoreflect.FileDescriptor + +var file_sync_v1_group_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5a, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x34, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x52, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x61, 0x73, 0x69, 0x63, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x22, 0xad, 0x02, 0x0a, 0x0a, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x61, 0x73, 0x69, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x3c, 0x5a, 0x3a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x75, 0x61, 0x6e, 0x6a, 0x69, + 0x54, 0x65, 0x63, 0x68, 0x2f, 0x6a, 0x54, 0x65, 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x2f, + 0x76, 0x31, 0x3b, 0x73, 0x79, 0x6e, 0x63, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_sync_v1_group_proto_rawDescOnce sync.Once + file_sync_v1_group_proto_rawDescData = file_sync_v1_group_proto_rawDesc +) + +func file_sync_v1_group_proto_rawDescGZIP() []byte { + file_sync_v1_group_proto_rawDescOnce.Do(func() { + file_sync_v1_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_sync_v1_group_proto_rawDescData) + }) + return file_sync_v1_group_proto_rawDescData +} + +var file_sync_v1_group_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sync_v1_group_proto_goTypes = []interface{}{ + (*Group)(nil), // 0: sync.v1.Group + (*GroupBasic)(nil), // 1: sync.v1.GroupBasic + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_sync_v1_group_proto_depIdxs = []int32{ + 1, // 0: sync.v1.Group.group_basic:type_name -> sync.v1.GroupBasic + 2, // 1: sync.v1.GroupBasic.created_at:type_name -> google.protobuf.Timestamp + 2, // 2: sync.v1.GroupBasic.updated_at:type_name -> google.protobuf.Timestamp + 2, // 3: sync.v1.GroupBasic.deleted_at:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_sync_v1_group_proto_init() } +func file_sync_v1_group_proto_init() { + if File_sync_v1_group_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sync_v1_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Group); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sync_v1_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupBasic); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sync_v1_group_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sync_v1_group_proto_goTypes, + DependencyIndexes: file_sync_v1_group_proto_depIdxs, + MessageInfos: file_sync_v1_group_proto_msgTypes, + }.Build() + File_sync_v1_group_proto = out.File + file_sync_v1_group_proto_rawDesc = nil + file_sync_v1_group_proto_goTypes = nil + file_sync_v1_group_proto_depIdxs = nil +} diff --git a/gen/proto/sync/v1/group.pb.ts b/gen/proto/sync/v1/group.pb.ts new file mode 100644 index 0000000..0ecc0ff --- /dev/null +++ b/gen/proto/sync/v1/group.pb.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +// @ts-nocheck +/* +* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY +*/ + +import * as GoogleProtobufTimestamp from "../../google/protobuf/timestamp.pb" +export type Group = { + groupBasic?: GroupBasic + memberId?: string[] +} + +export type GroupBasic = { + id?: string + createdAt?: GoogleProtobufTimestamp.Timestamp + updatedAt?: GoogleProtobufTimestamp.Timestamp + deletedAt?: GoogleProtobufTimestamp.Timestamp + name?: string + description?: string + avatar?: string + uid?: string +} \ No newline at end of file diff --git a/gen/proto/sync/v1/sync_service.pb.go b/gen/proto/sync/v1/sync_service.pb.go index 44defde..9db69b8 100644 --- a/gen/proto/sync/v1/sync_service.pb.go +++ b/gen/proto/sync/v1/sync_service.pb.go @@ -374,6 +374,193 @@ func (*UpdateResponse_SshKey) isUpdateResponse_Data() {} func (*UpdateResponse_Identity) isUpdateResponse_Data() {} +type UpdateGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` +} + +func (x *UpdateGroupRequest) Reset() { + *x = UpdateGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_sync_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGroupRequest) ProtoMessage() {} + +func (x *UpdateGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_sync_service_proto_msgTypes[4] + 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 UpdateGroupRequest.ProtoReflect.Descriptor instead. +func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { + return file_sync_v1_sync_service_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateGroupRequest) GetGroup() *Group { + if x != nil { + return x.Group + } + return nil +} + +type UpdateGroupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateGroupResponse) Reset() { + *x = UpdateGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_sync_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGroupResponse) ProtoMessage() {} + +func (x *UpdateGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_sync_service_proto_msgTypes[5] + 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 UpdateGroupResponse.ProtoReflect.Descriptor instead. +func (*UpdateGroupResponse) Descriptor() ([]byte, []int) { + return file_sync_v1_sync_service_proto_rawDescGZIP(), []int{5} +} + +type SyncGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + After *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=after,proto3" json:"after,omitempty"` +} + +func (x *SyncGroupRequest) Reset() { + *x = SyncGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_sync_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncGroupRequest) ProtoMessage() {} + +func (x *SyncGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_sync_service_proto_msgTypes[6] + 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 SyncGroupRequest.ProtoReflect.Descriptor instead. +func (*SyncGroupRequest) Descriptor() ([]byte, []int) { + return file_sync_v1_sync_service_proto_rawDescGZIP(), []int{6} +} + +func (x *SyncGroupRequest) GetAfter() *timestamppb.Timestamp { + if x != nil { + return x.After + } + return nil +} + +type SyncGroupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=server_time,json=serverTime,proto3" json:"server_time,omitempty"` + Groups []*Group `protobuf:"bytes,11,rep,name=groups,proto3" json:"groups,omitempty"` +} + +func (x *SyncGroupResponse) Reset() { + *x = SyncGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sync_v1_sync_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncGroupResponse) ProtoMessage() {} + +func (x *SyncGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_sync_v1_sync_service_proto_msgTypes[7] + 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 SyncGroupResponse.ProtoReflect.Descriptor instead. +func (*SyncGroupResponse) Descriptor() ([]byte, []int) { + return file_sync_v1_sync_service_proto_rawDescGZIP(), []int{7} +} + +func (x *SyncGroupResponse) GetServerTime() *timestamppb.Timestamp { + if x != nil { + return x.ServerTime + } + return nil +} + +func (x *SyncGroupResponse) GetGroups() []*Group { + if x != nil { + return x.Groups + } + return nil +} + var File_sync_v1_sync_service_proto protoreflect.FileDescriptor var file_sync_v1_sync_service_proto_rawDesc = []byte{ @@ -387,73 +574,105 @@ var file_sync_v1_sync_service_proto_rawDesc = []byte{ 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, - 0x68, 0x6f, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x53, - 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x66, - 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x96, 0x02, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x74, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, - 0x38, 0x0a, 0x0e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x0c, 0x6b, 0x6e, 0x6f, - 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x0b, 0x73, 0x73, 0x68, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x52, - 0x09, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x12, 0x34, 0x0a, 0x0c, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, - 0x22, 0xce, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, - 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x79, - 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, - 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x48, 0x00, - 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x79, 0x6e, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, - 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x22, 0xcf, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0a, 0x6b, 0x6e, 0x6f, - 0x77, 0x6e, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x2a, - 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x73, 0x68, 0x4b, 0x65, 0x79, - 0x48, 0x00, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, - 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, - 0x00, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x32, 0xb7, 0x01, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x14, 0x2e, 0x73, 0x79, - 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x12, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x79, 0x6e, 0x63, 0x12, 0x57, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, + 0x68, 0x6f, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x73, 0x79, 0x6e, + 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x5a, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x96, 0x02, 0x0a, + 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, + 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x07, 0x68, 0x6f, 0x73, + 0x74, 0x53, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x0e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, + 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, + 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x2f, + 0x0a, 0x0b, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x73, + 0x68, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x74, 0x12, + 0x34, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x18, + 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x53, 0x65, 0x74, 0x22, 0xce, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x48, 0x6f, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0a, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, + 0x48, 0x6f, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, 0x6f, 0x73, + 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x73, 0x68, + 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, + 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x48, 0x00, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x06, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xcf, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x73, + 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x33, + 0x0a, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x6e, 0x6f, + 0x77, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x48, + 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x73, 0x68, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, + 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, + 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x0a, 0x10, 0x53, + 0x79, 0x6e, 0x63, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x30, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x22, 0x78, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x0b, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x32, 0x91, 0x03, 0x0a, 0x0b, + 0x53, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x53, + 0x79, 0x6e, 0x63, 0x12, 0x14, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x79, 0x6e, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x5a, 0x0a, 0x06, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x3c, 0x5a, - 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x75, 0x61, 0x6e, - 0x6a, 0x69, 0x54, 0x65, 0x63, 0x68, 0x2f, 0x6a, 0x54, 0x65, 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x79, 0x6e, - 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x79, 0x6e, 0x63, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, + 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x6f, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1b, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, + 0x67, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x64, 0x0a, 0x09, 0x53, 0x79, 0x6e, + 0x63, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x19, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x6e, + 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, + 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x75, + 0x61, 0x6e, 0x6a, 0x69, 0x54, 0x65, 0x63, 0x68, 0x2f, 0x6a, 0x54, 0x65, 0x72, 0x6d, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, + 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x79, 0x6e, 0x63, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -468,42 +687,55 @@ func file_sync_v1_sync_service_proto_rawDescGZIP() []byte { return file_sync_v1_sync_service_proto_rawDescData } -var file_sync_v1_sync_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_sync_v1_sync_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_sync_v1_sync_service_proto_goTypes = []interface{}{ (*SyncRequest)(nil), // 0: sync.v1.SyncRequest (*SyncResponse)(nil), // 1: sync.v1.SyncResponse (*UpdateRequest)(nil), // 2: sync.v1.UpdateRequest (*UpdateResponse)(nil), // 3: sync.v1.UpdateResponse - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp - (*Host)(nil), // 5: sync.v1.Host - (*KnownHost)(nil), // 6: sync.v1.KnownHost - (*SshKey)(nil), // 7: sync.v1.SshKey - (*Identity)(nil), // 8: sync.v1.Identity + (*UpdateGroupRequest)(nil), // 4: sync.v1.UpdateGroupRequest + (*UpdateGroupResponse)(nil), // 5: sync.v1.UpdateGroupResponse + (*SyncGroupRequest)(nil), // 6: sync.v1.SyncGroupRequest + (*SyncGroupResponse)(nil), // 7: sync.v1.SyncGroupResponse + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (*Host)(nil), // 9: sync.v1.Host + (*KnownHost)(nil), // 10: sync.v1.KnownHost + (*SshKey)(nil), // 11: sync.v1.SshKey + (*Identity)(nil), // 12: sync.v1.Identity + (*Group)(nil), // 13: sync.v1.Group } var file_sync_v1_sync_service_proto_depIdxs = []int32{ - 4, // 0: sync.v1.SyncRequest.after:type_name -> google.protobuf.Timestamp - 4, // 1: sync.v1.SyncResponse.server_time:type_name -> google.protobuf.Timestamp - 5, // 2: sync.v1.SyncResponse.host_set:type_name -> sync.v1.Host - 6, // 3: sync.v1.SyncResponse.known_host_set:type_name -> sync.v1.KnownHost - 7, // 4: sync.v1.SyncResponse.ssh_key_set:type_name -> sync.v1.SshKey - 8, // 5: sync.v1.SyncResponse.identity_set:type_name -> sync.v1.Identity - 5, // 6: sync.v1.UpdateRequest.host:type_name -> sync.v1.Host - 6, // 7: sync.v1.UpdateRequest.known_host:type_name -> sync.v1.KnownHost - 7, // 8: sync.v1.UpdateRequest.ssh_key:type_name -> sync.v1.SshKey - 8, // 9: sync.v1.UpdateRequest.identity:type_name -> sync.v1.Identity - 5, // 10: sync.v1.UpdateResponse.host:type_name -> sync.v1.Host - 6, // 11: sync.v1.UpdateResponse.known_host:type_name -> sync.v1.KnownHost - 7, // 12: sync.v1.UpdateResponse.ssh_key:type_name -> sync.v1.SshKey - 8, // 13: sync.v1.UpdateResponse.identity:type_name -> sync.v1.Identity - 0, // 14: sync.v1.SyncService.Sync:input_type -> sync.v1.SyncRequest - 2, // 15: sync.v1.SyncService.Update:input_type -> sync.v1.UpdateRequest - 1, // 16: sync.v1.SyncService.Sync:output_type -> sync.v1.SyncResponse - 3, // 17: sync.v1.SyncService.Update:output_type -> sync.v1.UpdateResponse - 16, // [16:18] is the sub-list for method output_type - 14, // [14:16] 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 + 8, // 0: sync.v1.SyncRequest.after:type_name -> google.protobuf.Timestamp + 8, // 1: sync.v1.SyncResponse.server_time:type_name -> google.protobuf.Timestamp + 9, // 2: sync.v1.SyncResponse.host_set:type_name -> sync.v1.Host + 10, // 3: sync.v1.SyncResponse.known_host_set:type_name -> sync.v1.KnownHost + 11, // 4: sync.v1.SyncResponse.ssh_key_set:type_name -> sync.v1.SshKey + 12, // 5: sync.v1.SyncResponse.identity_set:type_name -> sync.v1.Identity + 9, // 6: sync.v1.UpdateRequest.host:type_name -> sync.v1.Host + 10, // 7: sync.v1.UpdateRequest.known_host:type_name -> sync.v1.KnownHost + 11, // 8: sync.v1.UpdateRequest.ssh_key:type_name -> sync.v1.SshKey + 12, // 9: sync.v1.UpdateRequest.identity:type_name -> sync.v1.Identity + 9, // 10: sync.v1.UpdateResponse.host:type_name -> sync.v1.Host + 10, // 11: sync.v1.UpdateResponse.known_host:type_name -> sync.v1.KnownHost + 11, // 12: sync.v1.UpdateResponse.ssh_key:type_name -> sync.v1.SshKey + 12, // 13: sync.v1.UpdateResponse.identity:type_name -> sync.v1.Identity + 13, // 14: sync.v1.UpdateGroupRequest.group:type_name -> sync.v1.Group + 8, // 15: sync.v1.SyncGroupRequest.after:type_name -> google.protobuf.Timestamp + 8, // 16: sync.v1.SyncGroupResponse.server_time:type_name -> google.protobuf.Timestamp + 13, // 17: sync.v1.SyncGroupResponse.groups:type_name -> sync.v1.Group + 0, // 18: sync.v1.SyncService.Sync:input_type -> sync.v1.SyncRequest + 2, // 19: sync.v1.SyncService.Update:input_type -> sync.v1.UpdateRequest + 4, // 20: sync.v1.SyncService.UpdateGroup:input_type -> sync.v1.UpdateGroupRequest + 6, // 21: sync.v1.SyncService.SyncGroup:input_type -> sync.v1.SyncGroupRequest + 1, // 22: sync.v1.SyncService.Sync:output_type -> sync.v1.SyncResponse + 3, // 23: sync.v1.SyncService.Update:output_type -> sync.v1.UpdateResponse + 5, // 24: sync.v1.SyncService.UpdateGroup:output_type -> sync.v1.UpdateGroupResponse + 7, // 25: sync.v1.SyncService.SyncGroup:output_type -> sync.v1.SyncGroupResponse + 22, // [22:26] is the sub-list for method output_type + 18, // [18:22] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_sync_v1_sync_service_proto_init() } @@ -514,6 +746,7 @@ func file_sync_v1_sync_service_proto_init() { file_sync_v1_host_proto_init() file_sync_v1_keychain_proto_init() file_sync_v1_known_hosts_proto_init() + file_sync_v1_group_proto_init() if !protoimpl.UnsafeEnabled { file_sync_v1_sync_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncRequest); i { @@ -563,6 +796,54 @@ func file_sync_v1_sync_service_proto_init() { return nil } } + file_sync_v1_sync_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateGroupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sync_v1_sync_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateGroupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sync_v1_sync_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncGroupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sync_v1_sync_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncGroupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_sync_v1_sync_service_proto_msgTypes[2].OneofWrappers = []interface{}{ (*UpdateRequest_Host)(nil), @@ -582,7 +863,7 @@ func file_sync_v1_sync_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_sync_v1_sync_service_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/proto/sync/v1/sync_service.pb.gw.go b/gen/proto/sync/v1/sync_service.pb.gw.go index c2a2c22..5151082 100644 --- a/gen/proto/sync/v1/sync_service.pb.gw.go +++ b/gen/proto/sync/v1/sync_service.pb.gw.go @@ -67,18 +67,15 @@ func local_request_SyncService_Sync_0(ctx context.Context, marshaler runtime.Mar } -var ( - filter_SyncService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - func request_SyncService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client SyncServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SyncService_Update_0); err != nil { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -91,14 +88,85 @@ func local_request_SyncService_Update_0(ctx context.Context, marshaler runtime.M var protoReq UpdateRequest var metadata runtime.ServerMetadata + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Update(ctx, &protoReq) + return msg, metadata, err + +} + +func request_SyncService_UpdateGroup_0(ctx context.Context, marshaler runtime.Marshaler, client SyncServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateGroupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SyncService_UpdateGroup_0(ctx context.Context, marshaler runtime.Marshaler, server SyncServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateGroupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateGroup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SyncService_SyncGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SyncService_SyncGroup_0(ctx context.Context, marshaler runtime.Marshaler, client SyncServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncGroupRequest + var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SyncService_Update_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SyncService_SyncGroup_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Update(ctx, &protoReq) + msg, err := client.SyncGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SyncService_SyncGroup_0(ctx context.Context, marshaler runtime.Marshaler, server SyncServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SyncGroupRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SyncService_SyncGroup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SyncGroup(ctx, &protoReq) return msg, metadata, err } @@ -159,6 +227,56 @@ func RegisterSyncServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_SyncService_UpdateGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/sync.v1.SyncService/UpdateGroup", runtime.WithHTTPPathPattern("/gapi/sync/v1/update_group")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SyncService_UpdateGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SyncService_UpdateGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SyncService_SyncGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/sync.v1.SyncService/SyncGroup", runtime.WithHTTPPathPattern("/gapi/sync/v1/sync_group")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SyncService_SyncGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SyncService_SyncGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -244,6 +362,50 @@ func RegisterSyncServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_SyncService_UpdateGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/sync.v1.SyncService/UpdateGroup", runtime.WithHTTPPathPattern("/gapi/sync/v1/update_group")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SyncService_UpdateGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SyncService_UpdateGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SyncService_SyncGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/sync.v1.SyncService/SyncGroup", runtime.WithHTTPPathPattern("/gapi/sync/v1/sync_group")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SyncService_SyncGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_SyncService_SyncGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -251,10 +413,18 @@ var ( pattern_SyncService_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"gapi", "sync", "v1"}, "")) pattern_SyncService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gapi", "sync", "v1", "update"}, "")) + + pattern_SyncService_UpdateGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gapi", "sync", "v1", "update_group"}, "")) + + pattern_SyncService_SyncGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gapi", "sync", "v1", "sync_group"}, "")) ) var ( forward_SyncService_Sync_0 = runtime.ForwardResponseMessage forward_SyncService_Update_0 = runtime.ForwardResponseMessage + + forward_SyncService_UpdateGroup_0 = runtime.ForwardResponseMessage + + forward_SyncService_SyncGroup_0 = runtime.ForwardResponseMessage ) diff --git a/gen/proto/sync/v1/sync_service.pb.ts b/gen/proto/sync/v1/sync_service.pb.ts index d0346d1..81be70f 100644 --- a/gen/proto/sync/v1/sync_service.pb.ts +++ b/gen/proto/sync/v1/sync_service.pb.ts @@ -6,6 +6,7 @@ import * as fm from "../../fetch.pb" import * as GoogleProtobufTimestamp from "../../google/protobuf/timestamp.pb" +import * as SyncV1Group from "./group.pb" import * as SyncV1Host from "./host.pb" import * as SyncV1Keychain from "./keychain.pb" import * as SyncV1Known_hosts from "./known_hosts.pb" @@ -45,11 +46,33 @@ type BaseUpdateResponse = { export type UpdateResponse = BaseUpdateResponse & OneOf<{ host: SyncV1Host.Host; knownHost: SyncV1Known_hosts.KnownHost; sshKey: SyncV1Keychain.SshKey; identity: SyncV1Keychain.Identity }> +export type UpdateGroupRequest = { + group?: SyncV1Group.Group +} + +export type UpdateGroupResponse = { +} + +export type SyncGroupRequest = { + after?: GoogleProtobufTimestamp.Timestamp +} + +export type SyncGroupResponse = { + serverTime?: GoogleProtobufTimestamp.Timestamp + groups?: SyncV1Group.Group[] +} + export class SyncService { static Sync(req: SyncRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/gapi/sync/v1/sync?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static Update(req: UpdateRequest, initReq?: fm.InitReq): Promise { - return fm.fetchReq(`/gapi/sync/v1/update`, {...initReq, method: "POST"}) + return fm.fetchReq(`/gapi/sync/v1/update`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)}) + } + static UpdateGroup(req: UpdateGroupRequest, initReq?: fm.InitReq): Promise { + return fm.fetchReq(`/gapi/sync/v1/update_group`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)}) + } + static SyncGroup(req: SyncGroupRequest, initReq?: fm.InitReq): Promise { + return fm.fetchReq(`/gapi/sync/v1/sync_group?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } } \ No newline at end of file diff --git a/gen/proto/sync/v1/sync_service_grpc.pb.go b/gen/proto/sync/v1/sync_service_grpc.pb.go index d544a1b..635dc1d 100644 --- a/gen/proto/sync/v1/sync_service_grpc.pb.go +++ b/gen/proto/sync/v1/sync_service_grpc.pb.go @@ -19,8 +19,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - SyncService_Sync_FullMethodName = "/sync.v1.SyncService/Sync" - SyncService_Update_FullMethodName = "/sync.v1.SyncService/Update" + SyncService_Sync_FullMethodName = "/sync.v1.SyncService/Sync" + SyncService_Update_FullMethodName = "/sync.v1.SyncService/Update" + SyncService_UpdateGroup_FullMethodName = "/sync.v1.SyncService/UpdateGroup" + SyncService_SyncGroup_FullMethodName = "/sync.v1.SyncService/SyncGroup" ) // SyncServiceClient is the client API for SyncService service. @@ -31,6 +33,10 @@ type SyncServiceClient interface { Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) // 提交最新配置 若配置的ID为空,则创建新配置。若配置的删除时间不为空,则代表该配置已被删除。 Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) + // 更新组信息 + UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) + // 通过UID获取所有组信息 + SyncGroup(ctx context.Context, in *SyncGroupRequest, opts ...grpc.CallOption) (*SyncGroupResponse, error) } type syncServiceClient struct { @@ -59,6 +65,24 @@ func (c *syncServiceClient) Update(ctx context.Context, in *UpdateRequest, opts return out, nil } +func (c *syncServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) { + out := new(UpdateGroupResponse) + err := c.cc.Invoke(ctx, SyncService_UpdateGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *syncServiceClient) SyncGroup(ctx context.Context, in *SyncGroupRequest, opts ...grpc.CallOption) (*SyncGroupResponse, error) { + out := new(SyncGroupResponse) + err := c.cc.Invoke(ctx, SyncService_SyncGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // SyncServiceServer is the server API for SyncService service. // All implementations must embed UnimplementedSyncServiceServer // for forward compatibility @@ -67,6 +91,10 @@ type SyncServiceServer interface { Sync(context.Context, *SyncRequest) (*SyncResponse, error) // 提交最新配置 若配置的ID为空,则创建新配置。若配置的删除时间不为空,则代表该配置已被删除。 Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + // 更新组信息 + UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) + // 通过UID获取所有组信息 + SyncGroup(context.Context, *SyncGroupRequest) (*SyncGroupResponse, error) mustEmbedUnimplementedSyncServiceServer() } @@ -80,6 +108,12 @@ func (UnimplementedSyncServiceServer) Sync(context.Context, *SyncRequest) (*Sync func (UnimplementedSyncServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } +func (UnimplementedSyncServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") +} +func (UnimplementedSyncServiceServer) SyncGroup(context.Context, *SyncGroupRequest) (*SyncGroupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncGroup not implemented") +} func (UnimplementedSyncServiceServer) mustEmbedUnimplementedSyncServiceServer() {} // UnsafeSyncServiceServer may be embedded to opt out of forward compatibility for this service. @@ -129,6 +163,42 @@ func _SyncService_Update_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _SyncService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SyncServiceServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SyncService_UpdateGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SyncServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SyncService_SyncGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SyncServiceServer).SyncGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SyncService_SyncGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SyncServiceServer).SyncGroup(ctx, req.(*SyncGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SyncService_ServiceDesc is the grpc.ServiceDesc for SyncService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -144,6 +214,14 @@ var SyncService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Update", Handler: _SyncService_Update_Handler, }, + { + MethodName: "UpdateGroup", + Handler: _SyncService_UpdateGroup_Handler, + }, + { + MethodName: "SyncGroup", + Handler: _SyncService_SyncGroup_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sync/v1/sync_service.proto", diff --git a/proto/sync/v1/group.proto b/proto/sync/v1/group.proto new file mode 100644 index 0000000..585f9b2 --- /dev/null +++ b/proto/sync/v1/group.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package sync.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/juanjiTech/jTerm-proto/gen/proto/sync/v1;syncV1"; + +message Group { + GroupBasic group_basic = 1; + repeated string member_id = 2; +} + +message GroupBasic { + string id = 1; + google.protobuf.Timestamp created_at = 2; + google.protobuf.Timestamp updated_at = 3; + google.protobuf.Timestamp deleted_at = 4; + string name = 5; + string description = 6; + string avatar = 7; + string uid = 8; // 创建者 +} diff --git a/proto/sync/v1/sync_service.proto b/proto/sync/v1/sync_service.proto index 1be79f4..444ec07 100644 --- a/proto/sync/v1/sync_service.proto +++ b/proto/sync/v1/sync_service.proto @@ -6,6 +6,7 @@ import "google/protobuf/timestamp.proto"; import "sync/v1/host.proto"; import "sync/v1/keychain.proto"; import "sync/v1/known_hosts.proto"; +import "sync/v1/group.proto"; option go_package = "github.com/juanjiTech/jTerm-proto/gen/proto/sync/v1;syncV1"; @@ -16,7 +17,21 @@ service SyncService { } // 提交最新配置 若配置的ID为空,则创建新配置。若配置的删除时间不为空,则代表该配置已被删除。 rpc Update(UpdateRequest) returns (UpdateResponse) { - option (google.api.http) = {post:"/gapi/sync/v1/update"}; + option (google.api.http) = { + post:"/gapi/sync/v1/update" + body: "*" + }; + } + // 更新组信息 + rpc UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse) { + option (google.api.http) = { + post:"/gapi/sync/v1/update_group" + body: "*" + }; + } + // 通过UID获取所有组信息 + rpc SyncGroup(SyncGroupRequest) returns (SyncGroupResponse) { + option (google.api.http) = {get:"/gapi/sync/v1/sync_group"}; } } @@ -49,4 +64,19 @@ message UpdateResponse { SshKey ssh_key = 13; Identity identity = 14; } +} + +message UpdateGroupRequest { + Group group = 1; +} + +message UpdateGroupResponse {} + +message SyncGroupRequest { + google.protobuf.Timestamp after = 1; +} + +message SyncGroupResponse { + google.protobuf.Timestamp server_time = 1; + repeated Group groups = 11; } \ No newline at end of file