diff --git a/admin/client.go b/admin/client.go index 192bd7715..fddf21044 100644 --- a/admin/client.go +++ b/admin/client.go @@ -354,6 +354,20 @@ func (c *Client) ListChangeSummaries( return summaries, nil } +// GetServerVersion gets the server version. +func (c *Client) GetServerVersion(ctx context.Context) (*types.VersionDetail, error) { + response, err := c.client.GetServerVersion(ctx, connect.NewRequest(&api.GetServerVersionRequest{})) + if err != nil { + return nil, err + } + + return &types.VersionDetail{ + YorkieVersion: response.Msg.YorkieVersion, + GoVersion: response.Msg.GoVersion, + BuildDate: response.Msg.BuildDate, + }, nil +} + /** * withShardKey returns a context with the given shard key in metadata. */ diff --git a/api/docs/yorkie/v1/admin.openapi.yaml b/api/docs/yorkie/v1/admin.openapi.yaml index 409277c81..e566de6a5 100644 --- a/api/docs/yorkie/v1/admin.openapi.yaml +++ b/api/docs/yorkie/v1/admin.openapi.yaml @@ -82,6 +82,18 @@ paths: $ref: '#/components/responses/connect.error' tags: - yorkie.v1.AdminService + /yorkie.v1.AdminService/GetServerVersion: + post: + description: "" + requestBody: + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionRequest' + responses: + "200": + $ref: '#/components/responses/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionResponse' + default: + $ref: '#/components/responses/connect.error' + tags: + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetSnapshotMeta: post: description: "" @@ -246,6 +258,15 @@ components: schema: $ref: '#/components/schemas/yorkie.v1.GetProjectRequest' required: true + yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.GetServerVersionRequest' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.GetServerVersionRequest' + required: true yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaRequest: content: application/json: @@ -391,6 +412,15 @@ components: schema: $ref: '#/components/schemas/yorkie.v1.GetProjectResponse' description: "" + yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.GetServerVersionResponse' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.GetServerVersionResponse' + description: "" yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaResponse: content: application/json: @@ -868,6 +898,32 @@ components: type: object title: GetProjectResponse type: object + yorkie.v1.GetServerVersionRequest: + additionalProperties: false + description: "" + title: GetServerVersionRequest + type: object + yorkie.v1.GetServerVersionResponse: + additionalProperties: false + description: "" + properties: + buildDate: + additionalProperties: false + description: "" + title: build_date + type: string + goVersion: + additionalProperties: false + description: "" + title: go_version + type: string + yorkieVersion: + additionalProperties: false + description: "" + title: yorkie_version + type: string + title: GetServerVersionResponse + type: object yorkie.v1.GetSnapshotMetaRequest: additionalProperties: false description: "" diff --git a/api/types/version_info.go b/api/types/version_info.go new file mode 100644 index 000000000..f7e083ba5 --- /dev/null +++ b/api/types/version_info.go @@ -0,0 +1,22 @@ +package types + +// VersionInfo represents information of version. +type VersionInfo struct { + // ClientVersion is the yorkie cli version. + ClientVersion *VersionDetail `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"` + + // ServerVersion is the yorkie server version. + ServerVersion *VersionDetail `json:"serverVersion,omitempty" yaml:"serverVersion,omitempty"` +} + +// VersionDetail represents detail information of version. +type VersionDetail struct { + // YorkieVersion + YorkieVersion string `json:"yorkieVersion" yaml:"yorkieVersion"` + + // GoVersion + GoVersion string `json:"goVersion" yaml:"goVersion"` + + // BuildDate + BuildDate string `json:"buildDate" yaml:"buildDate"` +} diff --git a/api/yorkie/v1/admin.pb.go b/api/yorkie/v1/admin.pb.go index 02c79116a..6ce04fabe 100644 --- a/api/yorkie/v1/admin.pb.go +++ b/api/yorkie/v1/admin.pb.go @@ -1609,6 +1609,107 @@ func (x *ListChangesResponse) GetChanges() []*Change { return nil } +type GetServerVersionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetServerVersionRequest) Reset() { + *x = GetServerVersionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_yorkie_v1_admin_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServerVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServerVersionRequest) ProtoMessage() {} + +func (x *GetServerVersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_yorkie_v1_admin_proto_msgTypes[30] + 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 GetServerVersionRequest.ProtoReflect.Descriptor instead. +func (*GetServerVersionRequest) Descriptor() ([]byte, []int) { + return file_yorkie_v1_admin_proto_rawDescGZIP(), []int{30} +} + +type GetServerVersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + YorkieVersion string `protobuf:"bytes,1,opt,name=yorkie_version,json=yorkieVersion,proto3" json:"yorkie_version,omitempty"` + GoVersion string `protobuf:"bytes,2,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` + BuildDate string `protobuf:"bytes,3,opt,name=build_date,json=buildDate,proto3" json:"build_date,omitempty"` +} + +func (x *GetServerVersionResponse) Reset() { + *x = GetServerVersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_yorkie_v1_admin_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetServerVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetServerVersionResponse) ProtoMessage() {} + +func (x *GetServerVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_yorkie_v1_admin_proto_msgTypes[31] + 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 GetServerVersionResponse.ProtoReflect.Descriptor instead. +func (*GetServerVersionResponse) Descriptor() ([]byte, []int) { + return file_yorkie_v1_admin_proto_rawDescGZIP(), []int{31} +} + +func (x *GetServerVersionResponse) GetYorkieVersion() string { + if x != nil { + return x.YorkieVersion + } + return "" +} + +func (x *GetServerVersionResponse) GetGoVersion() string { + if x != nil { + return x.GoVersion + } + return "" +} + +func (x *GetServerVersionResponse) GetBuildDate() string { + if x != nil { + return x.BuildDate + } + return "" +} + var File_yorkie_v1_admin_proto protoreflect.FileDescriptor var file_yorkie_v1_admin_proto_rawDesc = []byte{ @@ -1773,92 +1874,107 @@ var file_yorkie_v1_admin_proto_rawDesc = []byte{ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x32, 0xf7, 0x09, 0x0a, 0x0c, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x06, - 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x12, 0x18, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, - 0x05, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x12, 0x17, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x18, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x49, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x79, - 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x79, 0x6f, - 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, - 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x51, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x12, 0x1e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x12, 0x1c, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x54, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x12, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x79, 0x6f, - 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x79, 0x6f, 0x72, - 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, - 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x79, - 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x79, - 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x6c, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x42, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x27, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x42, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x12, 0x21, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x79, - 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x22, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x2e, 0x79, 0x6f, 0x72, - 0x6b, 0x69, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2d, - 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x79, 0x6f, 0x72, 0x6b, + 0x69, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, + 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x44, 0x61, 0x74, 0x65, 0x32, 0xd6, 0x0a, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, + 0x55, 0x70, 0x12, 0x18, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x79, + 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x05, 0x4c, 0x6f, 0x67, + 0x49, 0x6e, 0x12, 0x17, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x6f, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x79, 0x6f, + 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, + 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, + 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x79, + 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x79, + 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, + 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x79, 0x6f, + 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, + 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x15, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x27, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, + 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, + 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x21, 0x2e, 0x79, + 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x79, 0x6f, + 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x12, 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x79, 0x6f, 0x72, 0x6b, + 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2d, 0x74, 0x65, 0x61, 0x6d, 0x2f, + 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1873,7 +1989,7 @@ func file_yorkie_v1_admin_proto_rawDescGZIP() []byte { return file_yorkie_v1_admin_proto_rawDescData } -var file_yorkie_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_yorkie_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_yorkie_v1_admin_proto_goTypes = []interface{}{ (*SignUpRequest)(nil), // 0: yorkie.v1.SignUpRequest (*SignUpResponse)(nil), // 1: yorkie.v1.SignUpResponse @@ -1905,24 +2021,26 @@ var file_yorkie_v1_admin_proto_goTypes = []interface{}{ (*SearchDocumentsResponse)(nil), // 27: yorkie.v1.SearchDocumentsResponse (*ListChangesRequest)(nil), // 28: yorkie.v1.ListChangesRequest (*ListChangesResponse)(nil), // 29: yorkie.v1.ListChangesResponse - (*User)(nil), // 30: yorkie.v1.User - (*Project)(nil), // 31: yorkie.v1.Project - (*UpdatableProjectFields)(nil), // 32: yorkie.v1.UpdatableProjectFields - (*DocumentSummary)(nil), // 33: yorkie.v1.DocumentSummary - (*Change)(nil), // 34: yorkie.v1.Change + (*GetServerVersionRequest)(nil), // 30: yorkie.v1.GetServerVersionRequest + (*GetServerVersionResponse)(nil), // 31: yorkie.v1.GetServerVersionResponse + (*User)(nil), // 32: yorkie.v1.User + (*Project)(nil), // 33: yorkie.v1.Project + (*UpdatableProjectFields)(nil), // 34: yorkie.v1.UpdatableProjectFields + (*DocumentSummary)(nil), // 35: yorkie.v1.DocumentSummary + (*Change)(nil), // 36: yorkie.v1.Change } var file_yorkie_v1_admin_proto_depIdxs = []int32{ - 30, // 0: yorkie.v1.SignUpResponse.user:type_name -> yorkie.v1.User - 31, // 1: yorkie.v1.CreateProjectResponse.project:type_name -> yorkie.v1.Project - 31, // 2: yorkie.v1.GetProjectResponse.project:type_name -> yorkie.v1.Project - 31, // 3: yorkie.v1.ListProjectsResponse.projects:type_name -> yorkie.v1.Project - 32, // 4: yorkie.v1.UpdateProjectRequest.fields:type_name -> yorkie.v1.UpdatableProjectFields - 31, // 5: yorkie.v1.UpdateProjectResponse.project:type_name -> yorkie.v1.Project - 33, // 6: yorkie.v1.ListDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary - 33, // 7: yorkie.v1.GetDocumentResponse.document:type_name -> yorkie.v1.DocumentSummary - 33, // 8: yorkie.v1.GetDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary - 33, // 9: yorkie.v1.SearchDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary - 34, // 10: yorkie.v1.ListChangesResponse.changes:type_name -> yorkie.v1.Change + 32, // 0: yorkie.v1.SignUpResponse.user:type_name -> yorkie.v1.User + 33, // 1: yorkie.v1.CreateProjectResponse.project:type_name -> yorkie.v1.Project + 33, // 2: yorkie.v1.GetProjectResponse.project:type_name -> yorkie.v1.Project + 33, // 3: yorkie.v1.ListProjectsResponse.projects:type_name -> yorkie.v1.Project + 34, // 4: yorkie.v1.UpdateProjectRequest.fields:type_name -> yorkie.v1.UpdatableProjectFields + 33, // 5: yorkie.v1.UpdateProjectResponse.project:type_name -> yorkie.v1.Project + 35, // 6: yorkie.v1.ListDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary + 35, // 7: yorkie.v1.GetDocumentResponse.document:type_name -> yorkie.v1.DocumentSummary + 35, // 8: yorkie.v1.GetDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary + 35, // 9: yorkie.v1.SearchDocumentsResponse.documents:type_name -> yorkie.v1.DocumentSummary + 36, // 10: yorkie.v1.ListChangesResponse.changes:type_name -> yorkie.v1.Change 0, // 11: yorkie.v1.AdminService.SignUp:input_type -> yorkie.v1.SignUpRequest 2, // 12: yorkie.v1.AdminService.LogIn:input_type -> yorkie.v1.LogInRequest 4, // 13: yorkie.v1.AdminService.DeleteAccount:input_type -> yorkie.v1.DeleteAccountRequest @@ -1938,23 +2056,25 @@ var file_yorkie_v1_admin_proto_depIdxs = []int32{ 24, // 23: yorkie.v1.AdminService.GetSnapshotMeta:input_type -> yorkie.v1.GetSnapshotMetaRequest 26, // 24: yorkie.v1.AdminService.SearchDocuments:input_type -> yorkie.v1.SearchDocumentsRequest 28, // 25: yorkie.v1.AdminService.ListChanges:input_type -> yorkie.v1.ListChangesRequest - 1, // 26: yorkie.v1.AdminService.SignUp:output_type -> yorkie.v1.SignUpResponse - 3, // 27: yorkie.v1.AdminService.LogIn:output_type -> yorkie.v1.LogInResponse - 5, // 28: yorkie.v1.AdminService.DeleteAccount:output_type -> yorkie.v1.DeleteAccountResponse - 7, // 29: yorkie.v1.AdminService.ChangePassword:output_type -> yorkie.v1.ChangePasswordResponse - 9, // 30: yorkie.v1.AdminService.CreateProject:output_type -> yorkie.v1.CreateProjectResponse - 13, // 31: yorkie.v1.AdminService.ListProjects:output_type -> yorkie.v1.ListProjectsResponse - 11, // 32: yorkie.v1.AdminService.GetProject:output_type -> yorkie.v1.GetProjectResponse - 15, // 33: yorkie.v1.AdminService.UpdateProject:output_type -> yorkie.v1.UpdateProjectResponse - 17, // 34: yorkie.v1.AdminService.ListDocuments:output_type -> yorkie.v1.ListDocumentsResponse - 19, // 35: yorkie.v1.AdminService.GetDocument:output_type -> yorkie.v1.GetDocumentResponse - 21, // 36: yorkie.v1.AdminService.GetDocuments:output_type -> yorkie.v1.GetDocumentsResponse - 23, // 37: yorkie.v1.AdminService.RemoveDocumentByAdmin:output_type -> yorkie.v1.RemoveDocumentByAdminResponse - 25, // 38: yorkie.v1.AdminService.GetSnapshotMeta:output_type -> yorkie.v1.GetSnapshotMetaResponse - 27, // 39: yorkie.v1.AdminService.SearchDocuments:output_type -> yorkie.v1.SearchDocumentsResponse - 29, // 40: yorkie.v1.AdminService.ListChanges:output_type -> yorkie.v1.ListChangesResponse - 26, // [26:41] is the sub-list for method output_type - 11, // [11:26] is the sub-list for method input_type + 30, // 26: yorkie.v1.AdminService.GetServerVersion:input_type -> yorkie.v1.GetServerVersionRequest + 1, // 27: yorkie.v1.AdminService.SignUp:output_type -> yorkie.v1.SignUpResponse + 3, // 28: yorkie.v1.AdminService.LogIn:output_type -> yorkie.v1.LogInResponse + 5, // 29: yorkie.v1.AdminService.DeleteAccount:output_type -> yorkie.v1.DeleteAccountResponse + 7, // 30: yorkie.v1.AdminService.ChangePassword:output_type -> yorkie.v1.ChangePasswordResponse + 9, // 31: yorkie.v1.AdminService.CreateProject:output_type -> yorkie.v1.CreateProjectResponse + 13, // 32: yorkie.v1.AdminService.ListProjects:output_type -> yorkie.v1.ListProjectsResponse + 11, // 33: yorkie.v1.AdminService.GetProject:output_type -> yorkie.v1.GetProjectResponse + 15, // 34: yorkie.v1.AdminService.UpdateProject:output_type -> yorkie.v1.UpdateProjectResponse + 17, // 35: yorkie.v1.AdminService.ListDocuments:output_type -> yorkie.v1.ListDocumentsResponse + 19, // 36: yorkie.v1.AdminService.GetDocument:output_type -> yorkie.v1.GetDocumentResponse + 21, // 37: yorkie.v1.AdminService.GetDocuments:output_type -> yorkie.v1.GetDocumentsResponse + 23, // 38: yorkie.v1.AdminService.RemoveDocumentByAdmin:output_type -> yorkie.v1.RemoveDocumentByAdminResponse + 25, // 39: yorkie.v1.AdminService.GetSnapshotMeta:output_type -> yorkie.v1.GetSnapshotMetaResponse + 27, // 40: yorkie.v1.AdminService.SearchDocuments:output_type -> yorkie.v1.SearchDocumentsResponse + 29, // 41: yorkie.v1.AdminService.ListChanges:output_type -> yorkie.v1.ListChangesResponse + 31, // 42: yorkie.v1.AdminService.GetServerVersion:output_type -> yorkie.v1.GetServerVersionResponse + 27, // [27:43] is the sub-list for method output_type + 11, // [11:27] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name @@ -2327,6 +2447,30 @@ func file_yorkie_v1_admin_proto_init() { return nil } } + file_yorkie_v1_admin_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServerVersionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_yorkie_v1_admin_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetServerVersionResponse); 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{ @@ -2334,7 +2478,7 @@ func file_yorkie_v1_admin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_yorkie_v1_admin_proto_rawDesc, NumEnums: 0, - NumMessages: 30, + NumMessages: 32, NumExtensions: 0, NumServices: 1, }, diff --git a/api/yorkie/v1/admin.proto b/api/yorkie/v1/admin.proto index 9162e787f..7888854ee 100644 --- a/api/yorkie/v1/admin.proto +++ b/api/yorkie/v1/admin.proto @@ -44,6 +44,8 @@ service AdminService { rpc SearchDocuments (SearchDocumentsRequest) returns (SearchDocumentsResponse) {} rpc ListChanges (ListChangesRequest) returns (ListChangesResponse) {} + + rpc GetServerVersion (GetServerVersionRequest) returns (GetServerVersionResponse) {} } message SignUpRequest { @@ -184,3 +186,11 @@ message ListChangesRequest { message ListChangesResponse { repeated Change changes = 1; } + +message GetServerVersionRequest {} + +message GetServerVersionResponse { + string yorkie_version = 1; + string go_version = 2; + string build_date = 3; +} diff --git a/api/yorkie/v1/v1connect/admin.connect.go b/api/yorkie/v1/v1connect/admin.connect.go index 84f412d65..736acab2e 100644 --- a/api/yorkie/v1/v1connect/admin.connect.go +++ b/api/yorkie/v1/v1connect/admin.connect.go @@ -90,6 +90,9 @@ const ( // AdminServiceListChangesProcedure is the fully-qualified name of the AdminService's ListChanges // RPC. AdminServiceListChangesProcedure = "/yorkie.v1.AdminService/ListChanges" + // AdminServiceGetServerVersionProcedure is the fully-qualified name of the AdminService's + // GetServerVersion RPC. + AdminServiceGetServerVersionProcedure = "/yorkie.v1.AdminService/GetServerVersion" ) // AdminServiceClient is a client for the yorkie.v1.AdminService service. @@ -109,6 +112,7 @@ type AdminServiceClient interface { GetSnapshotMeta(context.Context, *connect.Request[v1.GetSnapshotMetaRequest]) (*connect.Response[v1.GetSnapshotMetaResponse], error) SearchDocuments(context.Context, *connect.Request[v1.SearchDocumentsRequest]) (*connect.Response[v1.SearchDocumentsResponse], error) ListChanges(context.Context, *connect.Request[v1.ListChangesRequest]) (*connect.Response[v1.ListChangesResponse], error) + GetServerVersion(context.Context, *connect.Request[v1.GetServerVersionRequest]) (*connect.Response[v1.GetServerVersionResponse], error) } // NewAdminServiceClient constructs a client for the yorkie.v1.AdminService service. By default, it @@ -196,6 +200,11 @@ func NewAdminServiceClient(httpClient connect.HTTPClient, baseURL string, opts . baseURL+AdminServiceListChangesProcedure, opts..., ), + getServerVersion: connect.NewClient[v1.GetServerVersionRequest, v1.GetServerVersionResponse]( + httpClient, + baseURL+AdminServiceGetServerVersionProcedure, + opts..., + ), } } @@ -216,6 +225,7 @@ type adminServiceClient struct { getSnapshotMeta *connect.Client[v1.GetSnapshotMetaRequest, v1.GetSnapshotMetaResponse] searchDocuments *connect.Client[v1.SearchDocumentsRequest, v1.SearchDocumentsResponse] listChanges *connect.Client[v1.ListChangesRequest, v1.ListChangesResponse] + getServerVersion *connect.Client[v1.GetServerVersionRequest, v1.GetServerVersionResponse] } // SignUp calls yorkie.v1.AdminService.SignUp. @@ -293,6 +303,11 @@ func (c *adminServiceClient) ListChanges(ctx context.Context, req *connect.Reque return c.listChanges.CallUnary(ctx, req) } +// GetServerVersion calls yorkie.v1.AdminService.GetServerVersion. +func (c *adminServiceClient) GetServerVersion(ctx context.Context, req *connect.Request[v1.GetServerVersionRequest]) (*connect.Response[v1.GetServerVersionResponse], error) { + return c.getServerVersion.CallUnary(ctx, req) +} + // AdminServiceHandler is an implementation of the yorkie.v1.AdminService service. type AdminServiceHandler interface { SignUp(context.Context, *connect.Request[v1.SignUpRequest]) (*connect.Response[v1.SignUpResponse], error) @@ -310,6 +325,7 @@ type AdminServiceHandler interface { GetSnapshotMeta(context.Context, *connect.Request[v1.GetSnapshotMetaRequest]) (*connect.Response[v1.GetSnapshotMetaResponse], error) SearchDocuments(context.Context, *connect.Request[v1.SearchDocumentsRequest]) (*connect.Response[v1.SearchDocumentsResponse], error) ListChanges(context.Context, *connect.Request[v1.ListChangesRequest]) (*connect.Response[v1.ListChangesResponse], error) + GetServerVersion(context.Context, *connect.Request[v1.GetServerVersionRequest]) (*connect.Response[v1.GetServerVersionResponse], error) } // NewAdminServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -393,6 +409,11 @@ func NewAdminServiceHandler(svc AdminServiceHandler, opts ...connect.HandlerOpti svc.ListChanges, opts..., ) + adminServiceGetServerVersionHandler := connect.NewUnaryHandler( + AdminServiceGetServerVersionProcedure, + svc.GetServerVersion, + opts..., + ) return "/yorkie.v1.AdminService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case AdminServiceSignUpProcedure: @@ -425,6 +446,8 @@ func NewAdminServiceHandler(svc AdminServiceHandler, opts ...connect.HandlerOpti adminServiceSearchDocumentsHandler.ServeHTTP(w, r) case AdminServiceListChangesProcedure: adminServiceListChangesHandler.ServeHTTP(w, r) + case AdminServiceGetServerVersionProcedure: + adminServiceGetServerVersionHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -493,3 +516,7 @@ func (UnimplementedAdminServiceHandler) SearchDocuments(context.Context, *connec func (UnimplementedAdminServiceHandler) ListChanges(context.Context, *connect.Request[v1.ListChangesRequest]) (*connect.Response[v1.ListChangesResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("yorkie.v1.AdminService.ListChanges is not implemented")) } + +func (UnimplementedAdminServiceHandler) GetServerVersion(context.Context, *connect.Request[v1.GetServerVersionRequest]) (*connect.Response[v1.GetServerVersionResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("yorkie.v1.AdminService.GetServerVersion is not implemented")) +} diff --git a/cmd/yorkie/version.go b/cmd/yorkie/version.go index 573249324..590b8e33a 100644 --- a/cmd/yorkie/version.go +++ b/cmd/yorkie/version.go @@ -17,27 +17,163 @@ package main import ( - "fmt" + "context" + "encoding/json" + "errors" "runtime" + "connectrpc.com/connect" "github.com/spf13/cobra" + "github.com/spf13/viper" + "gopkg.in/yaml.v3" + "github.com/yorkie-team/yorkie/admin" + "github.com/yorkie-team/yorkie/api/types" + "github.com/yorkie-team/yorkie/cmd/yorkie/config" "github.com/yorkie-team/yorkie/internal/version" ) +var ( + clientOnly bool + output string +) + func newVersionCmd() *cobra.Command { return &cobra.Command{ - Use: "version", - Short: "Print the version number of Yorkie", + Use: "version", + Short: "Print the version number of Yorkie", + PreRunE: config.Preload, RunE: func(cmd *cobra.Command, args []string) error { - fmt.Printf("Yorkie: %s\n", version.Version) - fmt.Printf("Go: %s\n", runtime.Version()) - fmt.Printf("Build date: %s\n", version.BuildDate) + if err := ValidateOptions(); err != nil { + return err + } + + versionInfo := types.VersionInfo{ + ClientVersion: getClientVersion(), + } + + var serverErr error + if !clientOnly { + versionInfo.ServerVersion, serverErr = getServerVersion() + } + + if err := printVersionInfo(cmd, output, &versionInfo); err != nil { + return err + } + + if serverErr != nil { + printServerError(cmd, serverErr) + } + return nil }, } } +func getServerVersion() (*types.VersionDetail, error) { + rpcAddr := viper.GetString("rpcAddr") + auth, err := config.LoadAuth(rpcAddr) + if err != nil { + return nil, err + } + + cli, err := admin.Dial(rpcAddr, admin.WithToken(auth.Token), admin.WithInsecure(auth.Insecure)) + if err != nil { + return nil, err + } + defer cli.Close() + + ctx := context.Background() + sv, err := cli.GetServerVersion(ctx) + if err != nil { + return nil, err + } + + return sv, nil +} + +func getClientVersion() *types.VersionDetail { + return &types.VersionDetail{ + YorkieVersion: version.Version, + GoVersion: runtime.Version(), + BuildDate: version.BuildDate, + } +} + +func printServerError(cmd *cobra.Command, err error) { + cmd.Printf("Error fetching server version: ") + + connectErr := new(connect.Error) + if errors.As(err, &connectErr) { + switch connectErr.Code() { + // TODO(hyun98): Find cases where different error cases can occur, + // and display a user-friendly error message for each case. + // Furthermore, it would be good to improve it + // by creating a general-purpose error handling module for rpc communication. + // for example, rpc error handling reference: https://connectrpc.com/docs/go/errors/ + case connect.CodeUnimplemented: + cmd.Printf("The server does not support this operation. You might need to check your server version.\n") + default: + cmd.Println(err) + } + } else { + cmd.Println(err) + } +} + +func printVersionInfo(cmd *cobra.Command, output string, versionInfo *types.VersionInfo) error { + switch output { + case "": + cmd.Printf("Yorkie Client: %s\n", versionInfo.ClientVersion.YorkieVersion) + cmd.Printf("Go: %s\n", versionInfo.ClientVersion.GoVersion) + cmd.Printf("Build Date: %s\n", versionInfo.ClientVersion.BuildDate) + if versionInfo.ServerVersion != nil { + cmd.Printf("Yorkie Server: %s\n", versionInfo.ServerVersion.YorkieVersion) + cmd.Printf("Go: %s\n", versionInfo.ServerVersion.GoVersion) + cmd.Printf("Build Date: %s\n", versionInfo.ServerVersion.BuildDate) + } + case "yaml": + marshalled, err := yaml.Marshal(versionInfo) + if err != nil { + return errors.New("failed to marshal YAML") + } + cmd.Println(string(marshalled)) + case "json": + marshalled, err := json.MarshalIndent(versionInfo, "", " ") + if err != nil { + return errors.New("failed to marshal JSON") + } + cmd.Println(string(marshalled)) + default: + return errors.New("unknown output format") + } + return nil +} + +// ValidateOptions validates the provided options. +func ValidateOptions() error { + if output != "" && output != "yaml" && output != "json" { + return errors.New(`--output must be 'yaml' or 'json'`) + } + + return nil +} + func init() { - rootCmd.AddCommand(newVersionCmd()) + cmd := newVersionCmd() + cmd.Flags().BoolVar( + &clientOnly, + "client", + clientOnly, + "Shows client version only (no server required).", + ) + cmd.Flags().StringVarP( + &output, + "output", + "o", + output, + "One of 'yaml' or 'json'.", + ) + + rootCmd.AddCommand(cmd) } diff --git a/server/rpc/admin_server.go b/server/rpc/admin_server.go index 9352eed63..cc8c42bfe 100644 --- a/server/rpc/admin_server.go +++ b/server/rpc/admin_server.go @@ -19,12 +19,14 @@ package rpc import ( "context" "fmt" + "runtime" "connectrpc.com/connect" "github.com/yorkie-team/yorkie/api/converter" "github.com/yorkie-team/yorkie/api/types" api "github.com/yorkie-team/yorkie/api/yorkie/v1" + "github.com/yorkie-team/yorkie/internal/version" "github.com/yorkie-team/yorkie/pkg/document/key" "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/server/backend" @@ -485,3 +487,15 @@ func (s *adminServer) ListChanges( Changes: pbChanges, }), nil } + +// GetServerVersion get the version of yorkie server. +func (s *adminServer) GetServerVersion( + _ context.Context, + _ *connect.Request[api.GetServerVersionRequest], +) (*connect.Response[api.GetServerVersionResponse], error) { + return connect.NewResponse(&api.GetServerVersionResponse{ + YorkieVersion: version.Version, + GoVersion: runtime.Version(), + BuildDate: version.BuildDate, + }), nil +} diff --git a/server/rpc/server_test.go b/server/rpc/server_test.go index 1d0976882..159c686ed 100644 --- a/server/rpc/server_test.go +++ b/server/rpc/server_test.go @@ -218,6 +218,10 @@ func TestAdminRPCServerBackend(t *testing.T) { t.Run("admin list changes test", func(t *testing.T) { testcases.RunAdminListChangesTest(t, testClient, testAdminClient, testAdminAuthInterceptor) }) + + t.Run("admin get server version test", func(t *testing.T) { + testcases.RunAdminGetServerVersionTest(t, testAdminClient) + }) } func TestConfig_Validate(t *testing.T) { diff --git a/server/rpc/testcases/testcases.go b/server/rpc/testcases/testcases.go index 004f42c58..f2010b8e5 100644 --- a/server/rpc/testcases/testcases.go +++ b/server/rpc/testcases/testcases.go @@ -1121,3 +1121,24 @@ func RunAdminListChangesTest( assert.Equal(t, connect.CodeNotFound, connect.CodeOf(err)) assert.Equal(t, connecthelper.CodeOf(database.ErrDocumentNotFound), converter.ErrorCodeOf(err)) } + +// RunAdminGetServerVersionTest runs the GetServerVersion test in admin. +func RunAdminGetServerVersionTest( + t *testing.T, + testAdminClient v1connect.AdminServiceClient, +) { + versionResponse, err := testAdminClient.GetServerVersion( + context.Background(), + connect.NewRequest(&api.GetServerVersionRequest{}), + ) + + assert.NoError(t, err) + assert.NotNil(t, versionResponse) + + responseMsg := versionResponse.Msg + + assert.NotEmpty(t, responseMsg.YorkieVersion) + assert.NotEmpty(t, responseMsg.GoVersion) + assert.Regexp(t, `^\d+\.\d+\.\d+$`, responseMsg.YorkieVersion) + assert.Regexp(t, `^go\d+\.\d+(\.\d+)?$`, responseMsg.GoVersion) +} diff --git a/test/bench/tree_editing_bench_test.go b/test/bench/tree_editing_bench_test.go index 4b41d7bbc..a05215dbc 100644 --- a/test/bench/tree_editing_bench_test.go +++ b/test/bench/tree_editing_bench_test.go @@ -29,6 +29,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document/json" "github.com/yorkie-team/yorkie/test/helper" ) + func BenchmarkTree(b *testing.B) { verticesCounts := []int{10000, 20000, 30000}