-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
YutaKakiki
authored and
YutaKakiki
committed
Feb 7, 2025
1 parent
529ad86
commit a60dfc4
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# 【Go】 WEBフレームワークなしで開発する TODO API ハンズオン | ||
このリポジトリーは、Zenn書籍で扱っているハンズオンのソースコードです。 | ||
|
||
# エンドポイント | ||
| HTTPメソッド | エンドポイント | 説明 | | ||
|--------------|----------------------|-----------------------------| | ||
| POST | /user | 新しいユーザーを作成する | | ||
| DELETE | /user | ユーザーを削除する | | ||
| GET | /users | 全てのユーザーを取得する | | ||
| PATCH | /user | ユーザーのプロフィールを更新する | | ||
| POST | /tasks | 新しいタスクを作成する | | ||
| DELETE | /tasks/{id} | 指定したIDのタスクを削除する | | ||
| PATCH | /tasks/{id}/state | 指定したIDのタスクの状態を更新する | | ||
| GET | /tasks/{id} | 指定したIDのタスクを取得する | | ||
| GET | /tasks | 全てのタスクを取得する | | ||
| GET | /user/tasks | ユーザーに紐づくタスクを取得する | | ||
| POST | /login | ログインを行う | | ||
| DELETE | /logout | ログアウトを行う | | ||
|
||
# コマンド(一部) | ||
Makefileにタスクを定義しています。 | ||
|
||
## Docker関連 | ||
|
||
### コンテナビルド | ||
``` | ||
make build | ||
``` | ||
|
||
### コンテナ起動 | ||
同時に、プログラムが実行されます。 | ||
``` | ||
make up | ||
``` | ||
|
||
### コンテナ削除 | ||
``` | ||
make down | ||
``` | ||
|
||
## パッケージのインストール | ||
|
||
### appパッケージにインストール | ||
``` | ||
make get-app name="xxxxxxxx" | ||
``` | ||
|
||
### pkgパッケージにインストール | ||
``` | ||
make get-pkg name="xxxxxxxx" | ||
``` | ||
|
||
## DBマイグレーション | ||
|
||
### マイグレーションファイルの生成 | ||
``` | ||
make migrate-create name="xxxxxxxx" | ||
``` | ||
### マイグレーションを適用 | ||
``` | ||
make migrate-up | ||
``` | ||
|
||
### マイグレーションをロールバック | ||
``` | ||
make migrate-down | ||
``` | ||
|
||
## テスト | ||
### appパッケージ全体の単体テストを実行 | ||
``` | ||
make test-app | ||
``` | ||
### pkgパッケージ全体の単体テストを実行 | ||
``` | ||
make test-pkg | ||
``` | ||
|
||
### リポジトリのテスト | ||
``` | ||
make test-repo | ||
``` | ||
|
||
### エンドポイントの統合テストを実行 | ||
``` | ||
make test-integration | ||
``` | ||
ゴールデンファイルを生成する場合は`-update`フラグをつけます | ||
``` | ||
make test-integration -update | ||
``` | ||
|
||
|
||
|