Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joaorafa19/nlw-journey-2024-go
Api de planejamento de viagens em Go
https://github.com/joaorafa19/nlw-journey-2024-go
api gin go goapi-gen goimpl golang sqlc tern
Last synced: 2 months ago
JSON representation
Api de planejamento de viagens em Go
- Host: GitHub
- URL: https://github.com/joaorafa19/nlw-journey-2024-go
- Owner: JoaoRafa19
- Created: 2024-07-09T13:49:47.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T17:35:19.000Z (4 months ago)
- Last Synced: 2024-10-15T17:21:54.587Z (2 months ago)
- Topics: api, gin, go, goapi-gen, goimpl, golang, sqlc, tern
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# NLW Journey Go api
Nessa api é utilizado o `goapi-gen` para gerar código boilerplate para facilitar o desenvolvimento da API.
`sqlc` para gerar as interfaces das entidades das tabelas dos bancos de dados (não é um ORM)## Generate
```shell
go generate ./...
```### Generate interfaces implementation
Using goimpl
```shell
go install github.com/josharian/impl@latest
```ex.:
```shell
impl 'api API' github.com/JoaoRafa19/nlw-journey-2024-go/internal/api/spec.ServerInterface
```## Deps
#### Install all deps:
```shell
go mod tidy
```- **gomail** `github.com/wneessen/go-mail`
Usado para escrever emails em go- **goapi-gen**
Para gerar boilerplate da api com base na especificação do json
```shell
go install github.com/discord-gophers/goapi-gen@latest
```- **tern**
```shell
go install github.com/jackc/tern/v2@latest
```- **sqlc**
```shell
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
```## Generate
```shell
goapi-gen --out [output-file] [input json spec file]
```
Ex.:
```shell
goapi-gen --out .\internal\api\spec\journey.gen.spec.go .\internal\api\spec\journey.spec.json
```