Skip to content

Commit

Permalink
Merge branch 'main' into http-health-check
Browse files Browse the repository at this point in the history
  • Loading branch information
taeng0204 authored Aug 10, 2024
2 parents 2573e6a + 80c6ea0 commit 599cf2a
Show file tree
Hide file tree
Showing 19 changed files with 603 additions and 142 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and Yorkie adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [Unreleased]

## [0.4.30] - 2024-08-09

### Added

- Add HTTP health check handler for server health monitoring by @taeng0204 in https://github.com/yorkie-team/yorkie/pull/952
- Show Server Version in Yorkie CLI by @hyun98 in https://github.com/yorkie-team/yorkie/pull/938

## [0.4.29] - 2024-08-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
YORKIE_VERSION := 0.4.29
YORKIE_VERSION := 0.4.30

GO_PROJECT = github.com/yorkie-team/yorkie

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
[![CodeCov](https://img.shields.io/codecov/c/github/yorkie-team/yorkie)](https://codecov.io/gh/yorkie-team/yorkie)
[![Godoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/yorkie-team/yorkie)

Yorkie is an open source document store for building collaborative editing applications. Yorkie uses JSON-like documents(CRDT) with optional types.
Yorkie is an open-source document store for building real-time collaborative applications. It uses JSON-like documents(CRDT) with optional types.

Yorkie consists of three main components: Client, Document and Server.

```
Client "A" (Go) Self-Hosted Server Or Cloud MongoDB or MemDB
Client "A" (Go) Server(Cloud or Self-Hosted) MongoDB or MemDB
┌───────────────────┐ ┌────────────────────────┐ ┌───────────┐
│ Document "D-1" │◄─Changes─►│ Project "P-1" │ │ Changes │
│ { a: 1, b: {} } │ │ ┌───────────────────┐ │◄─►│ Snapshots │
Expand All @@ -33,10 +33,13 @@ Yorkie consists of three main components: Client, Document and Server.
└────────────────────┘
```

- Clients can have a replica of the document representing an application model locally on several devices.
- Each client can independently update the document on their local device, even while offline.
- When a network connection is available, the client figures out which changes need to be synced from one device to another, and brings them into the same state.
- If the document was changed concurrently on different devices, Yorkie automatically syncs the changes, so that every replica ends up in the same state with resolving conflict.
Key Features:

- Clients: Clients can have a local replica of the document representing an application model on several devices.
- Offline Editing: Each client can independently update the document on their local device, even while offline.
- Synchronization: When a network connection is available, the client figures out which changes need to be synced from one device to another, and brings them into the same state.
- Conflict Resolution: If the document was changed concurrently on different devices, Yorkie automatically syncs the changes, so that every replica ends up in the same state with resolving conflicts.
- Database Integration: Yorkie supports MongoDB and MemDB as the underlying data storage.

## Documentation

Expand Down
14 changes: 14 additions & 0 deletions admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: Yorkie
description: "Yorkie is an open source document store for building collaborative editing applications."
version: v0.4.29
version: v0.4.30
servers:
- url: https://api.yorkie.dev
description: Production server
Expand Down
58 changes: 57 additions & 1 deletion api/docs/yorkie/v1/admin.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.29
version: v0.4.30
servers:
- description: Production server
url: https://api.yorkie.dev
Expand Down Expand Up @@ -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: ""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie/v1/resources.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.29
version: v0.4.30
servers:
- description: Production server
url: https://api.yorkie.dev
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie/v1/yorkie.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.29
version: v0.4.30
servers:
- description: Production server
url: https://api.yorkie.dev
Expand Down
22 changes: 22 additions & 0 deletions api/types/version_info.go
Original file line number Diff line number Diff line change
@@ -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"`
}
Loading

0 comments on commit 599cf2a

Please sign in to comment.