Repository: akihiro-coder/driveshare-backend-go
Pull request #8: Feature/06 api table design
Author: login: akihirookuda95
Created: 2025-05-12T01:16:09Z | Merged: 2025-05-12T01:22:02Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Documentation**
  - Added a comprehensive API design document outlining the RESTful endpoints, request and response formats, and status codes for managing todo items in the Go-based todo application.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/learning/go_todo_app/docs/api_design.md b/learning/go_todo_app/docs/api_design.md
new file mode 100644
index 0000000..438931a
--- /dev/null
+++ b/learning/go_todo_app/docs/api_design.md
@@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
+- **Response (JSON)**
+```json
+[
+  {
+    "id": 1,
+    "title": "Buy milk",
+    "description": "2L low-fat",
+    "is_done": false
+  },
+  {
+    "id": 2,
+    "title": "Read book",
+    "description": "Go programming",
+    "is_done": true
+  }
+]
+```
+- **Status Codes**:
+  - `200 OK`: Todos retrieved successfully
+  - `401 Unauthorized`: User not authenticated(token expired)
+
+
+
+### PUT /todos/{id}
+- **Purpose**: Update a todo
+- **Request (JSON)**
+```json
+{
+ "id": 1,
+ "title": "Buy milk",
+ "description": "2L low-fat",
+ "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": true
+}
+```
+- **Status Codes**:
+ - `200 OK`: Todos retrieved successfully
+ - `404 Not Found`: Todo not found
+
+
+
+### DELETE /todos/{id}
+- **Purpose**: Delete a todo
+- **Request (JSON)**
+```json
+{
+  "id": 1
+}
+```
+- **Response (JSON)**
+```json
+{
+  "message": "Todo deleted successfully"
+}
+```
+- **Status Codes**:
+  - `200 OK`: Todo deleted successfully
+  - `404 Not Found`: Todo not found
+
+
+
+### GET /todos/{id}
+- **Purpose**: Get a specific todo
+- **Request (JSON)**
+```json
+{
+  "id": 1
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `200 OK`: Todo retrieved successfully
+  - `404 Not Found`: Todo not found
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/learning/go_todo_app/docs/er_diagram.png b/learning/go_todo_app/docs/er_diagram.png
new file mode 100644
index 0000000..bd19ac7
Binary files /dev/null and b/learning/go_todo_app/docs/er_diagram.png differ


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 3**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>learning/go_todo_app/docs/api_design.md (2)</summary><blockquote>

`1-22`: **Specify required HTTP headers for each endpoint**

The documentation omits the HTTP headers consumers must include (e.g., authentication and content type). For clarity, add a **Headers** section under each endpoint. For example:

```markdown
- **Headers**
  - `Authorization: Bearer <token>` (required)
  - `Content-Type: application/json` (required for POST/PUT)
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[grammar] ~1-~1: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ### POST /todos - **Purpose**: Create a new todo - **Re...

(TO_DO_HYPHEN)

---

[grammar] ~2-~2: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...POST /todos - **Purpose**: Create a new todo - **Request (JSON)** ```json {   "title...

(TO_DO_HYPHEN)

---

[grammar] ~21-~21: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... - **Status Codes**:   - `201 Created`: Todo created successfully   - `400 Bad Reque...

(TO_DO_HYPHEN)

</details>

</details>

---

`30-30`: **Fix typo in "request"**

Line 30 reads "No requst body". Correct the spelling to "No request body" for readability.

```diff
-  - No requst body
+  - No request body
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between a7a3143f094c071b93379bdb80de3ebce4614a6c and b49ba967d408f3f94474dc150dd68c6cbeeed958.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `learning/go_todo_app/docs/er_diagram.png` is excluded by `!**/*.png`

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `learning/go_todo_app/docs/api_design.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>learning/go_todo_app/docs/api_design.md</summary>

[grammar] ~1-~1: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ### POST /todos - **Purpose**: Create a new todo - **Re...

(TO_DO_HYPHEN)

---

[grammar] ~2-~2: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...POST /todos - **Purpose**: Create a new todo - **Request (JSON)** ```json {   "title...

(TO_DO_HYPHEN)

---

[grammar] ~21-~21: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ... - **Status Codes**:   - `201 Created`: Todo created successfully   - `400 Bad Reque...

(TO_DO_HYPHEN)

---

[grammar] ~27-~27: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...quest`: Invalid input data     ### GET /todos - **Purpose**: Get user's todos - **Req...

(TO_DO_HYPHEN)

---

[grammar] ~28-~28: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...## GET /todos - **Purpose**: Get user's todos - **Request (JSON)**   - No requst body...

(TO_DO_HYPHEN)

---

[grammar] ~49-~49: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...] ``` - **Status Codes**:   - `200 OK`: Todos retrieved successfully   - `401 Unautho...

(TO_DO_HYPHEN)

---

[grammar] ~54-~54: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...uthenticated(token expired)    ### PUT /todos/{id} - **Purpose**: Update a todo - **R...

(TO_DO_HYPHEN)

---

[grammar] ~55-~55: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...PUT /todos/{id} - **Purpose**: Update a todo - **Request (JSON)** ```json {  "id": 1...

(TO_DO_HYPHEN)

---

[grammar] ~75-~75: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ... } ``` - **Status Codes**:  - `200 OK`: Todos retrieved successfully  - `404 Not Foun...

(TO_DO_HYPHEN)

---

[grammar] ~76-~76: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...rieved successfully  - `404 Not Found`: Todo not found    ### DELETE /todos/{id} - *...

(TO_DO_HYPHEN)

---

[grammar] ~80-~80: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...t Found`: Todo not found    ### DELETE /todos/{id} - **Purpose**: Delete a todo - **R...

(TO_DO_HYPHEN)

---

[grammar] ~81-~81: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...ETE /todos/{id} - **Purpose**: Delete a todo - **Request (JSON)** ```json {   "id": ...

(TO_DO_HYPHEN)

---

[grammar] ~95-~95: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...} ``` - **Status Codes**:   - `200 OK`: Todo deleted successfully   - `404 Not Found...

(TO_DO_HYPHEN)

---

[grammar] ~96-~96: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...leted successfully   - `404 Not Found`: Todo not found    ### GET /todos/{id} - **Pu...

(TO_DO_HYPHEN)

---

[grammar] ~100-~100: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ... Not Found`: Todo not found    ### GET /todos/{id} - **Purpose**: Get a specific todo...

(TO_DO_HYPHEN)

---

[grammar] ~101-~101: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...odos/{id} - **Purpose**: Get a specific todo - **Request (JSON)** ```json {   "id": ...

(TO_DO_HYPHEN)

---

[grammar] ~118-~118: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...} ``` - **Status Codes**:   - `200 OK`: Todo retrieved successfully   - `404 Not Fou...

(TO_DO_HYPHEN)

---

[grammar] ~119-~119: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...ieved successfully   - `404 Not Found`: Todo not found               

(TO_DO_HYPHEN)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>learning/go_todo_app/docs/api_design.md</summary>

75-75: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1

(MD005, list-indent)

---

75-75: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

---

76-76: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1

(MD005, list-indent)

---

76-76: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-12T01:19:09Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR introduces a comprehensive API design document for the Go-based todo application, detailing all relevant RESTful endpoints.  
- Added API documentation for POST, GET, PUT, DELETE, and GET by id endpoints.  
- Specifies endpoints request/response formats and associated HTTP status codes.




state: COMMENTED
author_association: NONE
submitted_at: 2025-05-12T01:39:49Z

Review comments:
diff_hunk: @@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
+- **Response (JSON)**
+```json
+[
+  {
+    "id": 1,
+    "title": "Buy milk",
+    "description": "2L low-fat",
+    "is_done": false
+  },
+  {
+    "id": 2,
+    "title": "Read book",
+    "description": "Go programming",
+    "is_done": true
+  }
+]
+```
+- **Status Codes**:
+  - `200 OK`: Todos retrieved successfully
+  - `401 Unauthorized`: User not authenticated(token expired)
+
+
+
+### PUT /todos/{id}
+- **Purpose**: Update a todo
+- **Request (JSON)**
+```json
+{
+ "id": 1,
+ "title": "Buy milk",
+ "description": "2L low-fat",
+ "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": true
+}
+```
+- **Status Codes**:
+ - `200 OK`: Todos retrieved successfully
+ - `404 Not Found`: Todo not found
+
+
+
+### DELETE /todos/{id}
+- **Purpose**: Delete a todo
+- **Request (JSON)**
+```json
+{
+  "id": 1
+}
+```
+- **Response (JSON)**
+```json
+{
+  "message": "Todo deleted successfully"
+}
+```
+- **Status Codes**:
+  - `200 OK`: Todo deleted successfully
+  - `404 Not Found`: Todo not found
+
+
+
+### GET /todos/{id}
+- **Purpose**: Get a specific todo
+- **Request (JSON)**
+```json
+{
+  "id": 1
+}
+```
path: learning/go_todo_app/docs/api_design.md
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Remove unnecessary JSON body for GET /todos/{id}**

GET requests should not include a body. Document the `id` as a path parameter instead:

```diff
- - **Request (JSON)**
- ```json
- {
-   "id": 1
- }
- ```
+ - **Request Parameters**
+   - Path parameter: `id` (integer)
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-12T01:19:08Z
author_association: NONE
diff_hunk: @@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
+- **Response (JSON)**
+```json
+[
+  {
+    "id": 1,
+    "title": "Buy milk",
+    "description": "2L low-fat",
+    "is_done": false
+  },
+  {
+    "id": 2,
+    "title": "Read book",
+    "description": "Go programming",
+    "is_done": true
+  }
+]
+```
+- **Status Codes**:
+  - `200 OK`: Todos retrieved successfully
+  - `401 Unauthorized`: User not authenticated(token expired)
+
+
+
+### PUT /todos/{id}
+- **Purpose**: Update a todo
+- **Request (JSON)**
+```json
+{
+ "id": 1,
+ "title": "Buy milk",
+ "description": "2L low-fat",
+ "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": true
+}
+```
+- **Status Codes**:
+ - `200 OK`: Todos retrieved successfully
+ - `404 Not Found`: Todo not found
+
+
+
+### DELETE /todos/{id}
+- **Purpose**: Delete a todo
+- **Request (JSON)**
+```json
+{
+  "id": 1
+}
+```
path: learning/go_todo_app/docs/api_design.md
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Remove unnecessary JSON body for DELETE /todos/{id}**

DELETE endpoints use the `{id}` path parameter—no request body is needed. Replace the JSON block with a path‐parameter description:

```diff
- - **Request (JSON)**
- ```json
- {
-   "id": 1
- }
- ```
+ - **Request Parameters**
+   - Path parameter: `id` (integer)
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-12T01:19:08Z
author_association: NONE
diff_hunk: @@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
+- **Response (JSON)**
+```json
+[
+  {
+    "id": 1,
+    "title": "Buy milk",
+    "description": "2L low-fat",
+    "is_done": false
+  },
+  {
+    "id": 2,
+    "title": "Read book",
+    "description": "Go programming",
+    "is_done": true
+  }
+]
+```
+- **Status Codes**:
+  - `200 OK`: Todos retrieved successfully
+  - `401 Unauthorized`: User not authenticated(token expired)
+
+
+
+### PUT /todos/{id}
+- **Purpose**: Update a todo
+- **Request (JSON)**
+```json
+{
+ "id": 1,
+ "title": "Buy milk",
+ "description": "2L low-fat",
+ "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": true
+}
+```
+- **Status Codes**:
+ - `200 OK`: Todos retrieved successfully
+ - `404 Not Found`: Todo not found
path: learning/go_todo_app/docs/api_design.md
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

_⚠️ Potential issue_

**Correct status code description and indentation under PUT /todos/{id}**

The `200 OK` line currently reads "Todos retrieved successfully" and is indented by a single space, triggering markdownlint errors. It should describe an update operation and match the two-space indentation used elsewhere:

```diff
-  - `200 OK`: Todos retrieved successfully
+   - `200 OK`: Todo updated successfully
```
Ensure the hyphen is preceded by two spaces, not one, to align nested lists consistently.


> Committable suggestion skipped: line range outside the PR's diff.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[grammar] ~75-~75: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ... } ``` - **Status Codes**:  - `200 OK`: Todos retrieved successfully  - `404 Not Foun...

(TO_DO_HYPHEN)

---

[grammar] ~76-~76: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”?
Context: ...rieved successfully  - `404 Not Found`: Todo not found    ### DELETE /todos/{id} - *...

(TO_DO_HYPHEN)

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

75-75: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1

(MD005, list-indent)

---

75-75: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

---

76-76: Inconsistent indentation for list items at the same level
Expected: 0; Actual: 1

(MD005, list-indent)

---

76-76: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-12T01:19:08Z
author_association: NONE
diff_hunk: @@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
path: learning/go_todo_app/docs/api_design.md
user: login: Copilot
body: Typo in 'requst'; it should be corrected to 'request'.
```suggestion
  - No request body
```
created_at: 2025-05-12T01:39:48Z
author_association: NONE
diff_hunk: @@ -0,0 +1,133 @@
+### POST /todos
+- **Purpose**: Create a new todo
+- **Request (JSON)**
+```json
+{
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": false
+}
+```
+- **Status Codes**:
+  - `201 Created`: Todo created successfully
+  - `400 Bad Request`: Invalid input data
+
+
+
+
+### GET /todos
+- **Purpose**: Get user's todos
+- **Request (JSON)**
+  - No requst body
+- **Response (JSON)**
+```json
+[
+  {
+    "id": 1,
+    "title": "Buy milk",
+    "description": "2L low-fat",
+    "is_done": false
+  },
+  {
+    "id": 2,
+    "title": "Read book",
+    "description": "Go programming",
+    "is_done": true
+  }
+]
+```
+- **Status Codes**:
+  - `200 OK`: Todos retrieved successfully
+  - `401 Unauthorized`: User not authenticated(token expired)
+
+
+
+### PUT /todos/{id}
+- **Purpose**: Update a todo
+- **Request (JSON)**
+```json
+{
+ "id": 1,
+ "title": "Buy milk",
+ "description": "2L low-fat",
+ "is_done": false
+}
+```
+- **Response (JSON)**
+```json
+{
+  "id": 1,
+  "title": "Buy milk",
+  "description": "2L low-fat",
+  "is_done": true
+}
+```
+- **Status Codes**:
+ - `200 OK`: Todos retrieved successfully
path: learning/go_todo_app/docs/api_design.md
user: login: Copilot
body: For the PUT /todos/{id} endpoint, the success message should indicate that a todo has been updated rather than retrieved. Consider changing it to 'Todo updated successfully'.
```suggestion
 - `200 OK`: Todo updated successfully
```
created_at: 2025-05-12T01:39:49Z
author_association: NONE

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-12T01:16:14Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

A new API design document for a Go-based todo application has been added. The document outlines the RESTful endpoints for creating, retrieving, updating, and deleting todo items, specifying request/response formats, status codes, and endpoint purposes. No code or exported entities were changed; only documentation was introduced.

## Changes

| File(s)                                      | Change Summary                                                                                     |
|----------------------------------------------|----------------------------------------------------------------------------------------------------|
| learning/go_todo_app/docs/api_design.md      | Added a markdown document detailing the RESTful API endpoints, request/response formats, and codes |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Client
    participant API Server

    Client->>API Server: POST /todos (create todo)
    API Server-->>Client: 201 Created / 400 Bad Request

    Client->>API Server: GET /todos (list todos)
    API Server-->>Client: 200 OK / 401 Unauthorized

    Client->>API Server: GET /todos/{id} (fetch todo)
    API Server-->>Client: 200 OK / 404 Not Found

    Client->>API Server: PUT /todos/{id} (update todo)
    API Server-->>Client: 200 OK / 404 Not Found

    Client->>API Server: DELETE /todos/{id} (delete todo)
    API Server-->>Client: 200 OK / 404 Not Found
```

## Poem

> 📝  
> A document new, for todos in Go,  
> Endpoints described, so users will know.  
> With POST, GET, PUT, and DELETE by name,  
> Each status and field, precisely the same.  
> Now rabbits can code, with specs in their paw,  
> Hopping through APIs, without a flaw!  
> 🐇

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡️ Faster reviews with caching</summary>
> 
> - CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure `Review - Disable Cache` at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the `Data Retention` setting under your Organization Settings.
> 
> Enjoy the performance boost—your workflow just got faster.
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- 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 -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=akihiro-coder/driveshare-backend-go&utm_content=8):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: akihirookuda95
created_at: 2025-05-12T01:17:17Z
body: @coderabbitai review
author_association: OWNER
user: login: coderabbitai[bot]
created_at: 2025-05-12T01:17:22Z
body: <!-- This is an auto-generated reply by CodeRabbit -->
<details>
<summary>✅ Actions performed</summary>

Review triggered.

> Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

</details>
author_association: NONE