https://github.com/boraxpr/go-web-service
https://github.com/boraxpr/go-web-service
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/boraxpr/go-web-service
- Owner: boraxpr
- Created: 2024-02-16T05:02:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-30T15:52:49.000Z (about 2 years ago)
- Last Synced: 2025-04-01T11:22:26.502Z (about 1 year ago)
- Language: Go
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Web Service
This is a sample server for a Go web service.
## Getting Started
### Prerequisites
- Go 1.21 or higher
- PostgreSQL
- .env containing : PORT, DB_STRING, SECRET_KEY
### API-Definition
- Redirects all endpoint of /swagger/ to swagger/index.html (httpSwagger.handler of `go get github.com/swaggo/http-swagger/v2`)
#### How it was created
- Generates API definition from Annotations using swaggo/swag/cmd/swag@latest (`go install github.com/swaggo/swag/cmd/swag@latest`)
```
$ > swag init ./ --parseDependency
```
### API-Testing
- Manual testing can be done through swagger 2.0 API documents.
### Design Patterns
- Chain of Responsibility : Middleware
- Dependency Injection : Singleton database connection + Pgxpool concurrency supported