https://github.com/n3integration/conseil
Rapid application development with Go
https://github.com/n3integration/conseil
bootstrap capitalgo golang rapid-development
Last synced: 2 months ago
JSON representation
Rapid application development with Go
- Host: GitHub
- URL: https://github.com/n3integration/conseil
- Owner: n3integration
- License: apache-2.0
- Created: 2018-06-22T01:54:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-30T19:34:53.000Z (over 7 years ago)
- Last Synced: 2024-06-20T10:14:02.901Z (almost 2 years ago)
- Topics: bootstrap, capitalgo, golang, rapid-development
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# conseil [ ](https://app.codeship.com/projects/297512)
Inspired by the CapitalGo "Rapid Application Development" talk. This
project is a work in progress. If you're interested in
following the project progress, click the :star: above to be notified
when updates are available.
### Installation
```sh
go get -u github.com/n3integration/conseil
go install github.com/n3integration/conseil/cmd/conseil
```
## Usage
### Bootstrap a New Application
When bootstrapping a new Go application, there are multiple steps
that are required for each project. Use the `new` command to build
out the application scaffolding for a new application including:
git repo, dependency management, etc.
```sh
NAME:
conseil new - bootstrap a new application
USAGE:
conseil new [command options] [arguments...]
OPTIONS:
--framework value app framework [i.e. grpc, iris, ozzo, echo, gin] (default: "gin")
--host value ip address to bind (default: "127.0.0.1")
--port value local port to bind (default: 8080)
--migrations whether or not to include support for database migrations
--driver value database driver (default: "postgres")
--repo value the git module repository (default: "github.com")
--dep whether or not to initialize dependency management using dep
--mod whether or not to initialize dependency management using go modules
--git whether or not to initialize git repo
```
Once executed, the following project structure is setup:
```sh
.
|-- .gitignore (*requires --git)
|-- go.mod (*requires --mod)
|-- go.sum (*requires --mod)
|-- Gopkg.lock (*requires --dep)
|-- Gopkg.toml (*requires --dep)
|-- app.go
`-- sql (*requires --migrations)
|-- migrations
| |-- 1.down.sql
| `-- 1.up.sql
|-- migrations.go
`-- sql.go
3 directories, 7 files
```
The `app.go` file contains a basic application for the framework specified,
which includes a single stubbed `/health` endpoint.
#### Database Migrations
If your application requires database migrations, enable the `migrations`
option. This will setup a `sql/sql.go` file that initializes the database driver.
A `sql/migrations.go` is also created that can be invoked at startup to perform the
database schema migrations. It will also create a `sql/migrations` folder that
contains skeleton `up` and `down` migration templates. Otherwise, the `driver`
option is ignored.