Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergeywh1te/go-template
go-skeleton
https://github.com/sergeywh1te/go-template
gin go golang template
Last synced: 23 days ago
JSON representation
go-skeleton
- Host: GitHub
- URL: https://github.com/sergeywh1te/go-template
- Owner: sergeyWh1te
- License: mit
- Created: 2022-05-25T09:58:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-28T16:52:15.000Z (8 months ago)
- Last Synced: 2024-10-21T18:12:03.059Z (24 days ago)
- Topics: gin, go, golang, template
- Language: Go
- Homepage:
- Size: 551 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# go-template
go-skeleton-lido## How to use the template
1. Clone repository
2. cd root repository
3. make tools
4. make vendor
5. copy `sample.env` to `.env`
6. docker-compose up -d
7. make migrate
8. make build
9. Run service ./bin/service## How to create migrations?
./bin/migrate create -ext=sql -dir=db/migrations## How to make migrations?
1. make migrate from terminal or
```
bin/migrate -database ${POSTGRESQL_URL} -path db/migrations up
```## Where I have to start to code my custom logic?
* [Register handler](./internal/app/server/routes.go)
* [Logic layer](./internal/pkg/users): /internal/pkg/your_package_name/. Just see an example with [User package](./internal/pkg/users)
* [Env](./internal/env/env.go)
* [Connecters](./internal/connectors) pg, logger, redis and etc...
* For external clients you have to create folder in ./internal/clients//client.go where your_client_name - is google_client, alchemy or internal client for private network.## Docs and rules
1. [App structure layout](./docs/structure.md)
2. [Code style](./docs/code_style.md)## Current drivers or dependencies
1. Postgres - [pgx](https://github.com/jackc/pgx)
2. Logger - [Logrus](https://github.com/sirupsen/logrus)
3. Mockery [Mockery](https://github.com/vektra/mockery)
4. Http router [gorilla_mux](github.com/gorilla/mux). Of course your can change it for example to [Gin](https://github.com/gin-gonic/gin)
5. Env reader [Viper](https://github.com/spf13/viper)