https://github.com/sgaunet/template-api
template-api is a project to bootstrap a golang api project with go new command.
https://github.com/sgaunet/template-api
api-rest bootstrap golang template
Last synced: 5 months ago
JSON representation
template-api is a project to bootstrap a golang api project with go new command.
- Host: GitHub
- URL: https://github.com/sgaunet/template-api
- Owner: sgaunet
- License: mit
- Created: 2023-10-15T18:26:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-01T20:30:39.000Z (11 months ago)
- Last Synced: 2025-08-01T22:34:50.289Z (11 months ago)
- Topics: api-rest, bootstrap, golang, template
- Language: Go
- Homepage:
- Size: 251 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# template-api
[](https://goreportcard.com/report/github.com/sgaunet/template-api)



[](LICENSE)
[](https://github.com/sgaunet/template-api/actions/workflows/linter.yml)
[](https://github.com/sgaunet/template-api/actions/workflows/coverage.yml)
[](https://github.com/sgaunet/template-api/actions/workflows/snapshot.yml)
[](https://github.com/sgaunet/template-api/actions/workflows/release.yml)
template-api is an API REST template project.
```bash
# install gonew
go install golang.org/x/tools/cmd/gonew@latest
# use gonew to create your project based on this template
gonew github.com/sgaunet/template-api gitplatform.com/username/awesome_new_project
cd awesome_new_project
git init
git add .
git remote add origin git@gitplatform.com:username/awesome_new_project
git push -u origin master
```
## Run
```
$ cat cfg.yaml
dbdsn: postgres://user:password@host:port/dbname?sslmode=disable
$ template-api -cfg cfg.yaml
...
```
## Install
* Download the binary in the release section
* Or use the docker image
# Development
This project is using :
* golang
* [task for development](https://taskfile.dev/#/)
* docker
* [docker buildx](https://github.com/docker/buildx)
* docker manifest
* [goreleaser](https://goreleaser.com/)
* [pre-commit](https://pre-commit.com/)
There are hooks executed in the precommit stage. Once the project cloned on your disk, please install pre-commit:
```
brew install pre-commit
```
Install tools:
```
task dev:prereq
```
And install the hooks:
```
task dev:install
```
To launch manually the pre-commmit hook:
```
task dev:pre-commit
```