Simple API using repository pattern and GIN http library.
- User registration and login
- Authentication and Authorization with JWT library
- KRS and Score creation, update, and deletion
- GIN
go get -u github.com/gin-gonic/gin
- Gorm
go get -u gorm.io/gorm
go get -u gorm.io/driver/mysql
- Viper
go get github.com/spf13/viper
- JWT
go get -u github.com/golang-jwt/jwt/v5
Run the app
go run main.go
Method | Action | URL |
---|---|---|
POST | Login | /api/login |
POST | Register User | /api/register |
POST | Delete Session | /api/logout |
Method | Action | URL |
---|---|---|
GET | Get KRS by userID | /api/users/{userID}/krs |
GET | Get Score by userID | /api/users/{userID}/score |
Method | Action | URL |
---|---|---|
GET | Get all KRS | /api/krs |
GET | Get KRS by ID | /api/krs/{krsID} |
POST | Create KRS | /api/krs |
PUT | Update KRS | /api/krs/{krsID} |
DELETE | Delete KRS | /api/krs/{krsID} |
Method | Action | URL |
---|---|---|
GET | Get all Score | /api/score |
GET | Get Score by ID | /api/score/{scoreID} |
POST | Create Score | /api/score |
PUT | Update Score | /api/score/{scoreID} |
DELETE | Delete Score | /api/score/{scoreID} |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.