go-bootstrap - 一個 Go Web 項目生成器
這不是一個Web框架,它用于生成基于Go語言Web項目的一個基礎框架。
安裝
-
go get github.com/go-bootstrap/go-bootstrap
-
$GOPATH/bin/go-bootstrap -dir github.com/{git-user}/{project-name}
-
Start using it:cd $GOPATH/src/github.com/{git-user}/{project-name} && go run main.go
可以按需定制
這個生成器可以讓你做很多決定,以下是可用你項目的一些內容:
-
PostgreSQL is chosen for the database.
-
bcrypt is chosen as the password hasher.
-
Bootstrap Flatly is chosen for the UI theme.
-
Session is stored inside encrypted cookie.
-
Static directory is located under/static.
-
Model directory is located under/dal(Database Access Layer).
-
It does not use ORM nor installs one.
-
Test database is automatically created under$GO_BOOTSTRAP_PROJECT_NAME-test.
-
A minimal Dockerfile is provided.
-
A minimal Vagrantfile is provided.
-
github.com/tools/godep is chosen to manage dependencies.
-
github.com/jmoiron/sqlx is chosen to connect to a database.
-
github.com/gorilla is chosen for a lot of the HTTP plumbings.
-
github.com/carbocation/interpose is chosen as the middleware library.
-
github.com/tylerb/graceful is chosen to enable graceful shutdown.
-
github.com/mattes/migrate is chosen as the database migration tool.
-
github.com/Sirupsen/logrus is chosen as the logging library.