github.com/n3integration/conseil@v0.1.1/README.md (about) 1 # conseil [ ![Codeship Status for n3integration/conseil](https://app.codeship.com/projects/a59591e0-66f2-0136-ff01-5e954b520d34/status?branch=master)](https://app.codeship.com/projects/297512) 2 3 Inspired by the CapitalGo "Rapid Application Development" talk. This 4 project is a work in progress. If you're interested in 5 following the project progress, click the :star: above to be notified 6 when updates are available. 7 8 ### Installation 9 10 ```sh 11 go get -u github.com/n3integration/conseil 12 go install github.com/n3integration/conseil/cmd/conseil 13 ``` 14 15 ## Usage 16 17 ### Bootstrap a New Application 18 19 When bootstrapping a new Go application, there are multiple steps 20 that are required for each project. Use the `new` command to build 21 out the application scaffolding for a new application including: 22 git repo, dependency management, etc. 23 24 ```sh 25 NAME: 26 conseil new - bootstrap a new application 27 28 USAGE: 29 conseil new [command options] [arguments...] 30 31 OPTIONS: 32 --framework value app framework [i.e. grpc, iris, ozzo, echo, gin] (default: "gin") 33 --host value ip address to bind (default: "127.0.0.1") 34 --port value local port to bind (default: 8080) 35 --migrations whether or not to include support for database migrations 36 --driver value database driver (default: "postgres") 37 --repo value the git module repository (default: "github.com") 38 --dep whether or not to initialize dependency management using dep 39 --mod whether or not to initialize dependency management using go modules 40 --git whether or not to initialize git repo 41 ``` 42 43 Once executed, the following project structure is setup: 44 45 ```sh 46 . 47 |-- .gitignore (*requires --git) 48 |-- go.mod (*requires --mod) 49 |-- go.sum (*requires --mod) 50 |-- Gopkg.lock (*requires --dep) 51 |-- Gopkg.toml (*requires --dep) 52 |-- app.go 53 `-- sql (*requires --migrations) 54 |-- migrations 55 | |-- 1.down.sql 56 | `-- 1.up.sql 57 |-- migrations.go 58 `-- sql.go 59 60 3 directories, 7 files 61 62 ``` 63 64 The `app.go` file contains a basic application for the framework specified, 65 which includes a single stubbed `/health` endpoint. 66 67 #### Database Migrations 68 69 If your application requires database migrations, enable the `migrations` 70 option. This will setup a `sql/sql.go` file that initializes the database driver. 71 A `sql/migrations.go` is also created that can be invoked at startup to perform the 72 database schema migrations. It will also create a `sql/migrations` folder that 73 contains skeleton `up` and `down` migration templates. Otherwise, the `driver` 74 option is ignored. 75