Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gopher-lego/skeleton
Newer: https://github.com/gopher-lego/ginger
https://github.com/gopher-lego/skeleton
gin golang-project http-api laravel skeleton template
Last synced: about 1 month ago
JSON representation
Newer: https://github.com/gopher-lego/ginger
- Host: GitHub
- URL: https://github.com/gopher-lego/skeleton
- Owner: gopher-lego
- Created: 2020-05-20T09:44:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T15:20:01.000Z (almost 4 years ago)
- Last Synced: 2023-10-16T17:59:37.028Z (about 1 year ago)
- Topics: gin, golang-project, http-api, laravel, skeleton, template
- Language: Go
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# skeleton
Directory structure for sample golang project development.
There are several ways to use it.
## Run debug mode directly
```
$ vi app.debug.json
$ go run main.go bindata.go # To avoid syntaxx error only. (bindata.go only used in release mode)
```## Deploy release mode directly
```
# Update setting
$ cp app.mode.json.example app.release.json
$ vi app.release.json# Build & distribute
$ go-bindata -o bindata.go setting/ # generate bindata.go that is load for release mode which will never be changed
$ export GIN_MODE=release
$ "go build && ./skeleton" OR "go run main.go bindata.go"# Optional
$ scp skeleton [email protected]:/dist/
```## Deploy & Run release with docker locally
```
$ vi setting/app.release.json
$ dkc -f docker-compose-from-src.yml up -d --build --force-recreate
```## Deploy in CI/CD way (Github Actions)
```
# Update and push to release/prod branch trigger actions
$ vi .github/workflows/go.yml# On remote server
$ cd skeletonApi/dist
$ dkc -f docker-compose-from-dist.yml up -d --build --force-recreate
```## Preset features
Support global CORS middleware.
Support global Request Rate limit middleware.
Support config set by Viper in config/
Support load setting/ value into build binary by Working with bindata.go
Support production ready Docker environment out of box.
Support migration in migrate.go
## Development workflow
```
main.go ->
route/api.go ->
app/http/xx.go ->
app/repository/xxxRepo.go <- app/model/xxx.go
<- config/database.go
```