go-bootstrap - 一個 Go Web 項目生成器

jopen 9年前發布 | 32K 次閱讀 Google Go/Golang開發 go-bootstrap

這不是一個Web框架,它用于生成基于Go語言Web項目的一個基礎框架。

安裝

  1. go get github.com/go-bootstrap/go-bootstrap

  2. $GOPATH/bin/go-bootstrap -dir github.com/{git-user}/{project-name}

  3. Start using it:cd $GOPATH/src/github.com/{git-user}/{project-name} && go run main.go

可以按需定制

這個生成器可以讓你做很多決定,以下是可用你項目的一些內容:

  1. PostgreSQL is chosen for the database.

  2. bcrypt is chosen as the password hasher.

  3. Bootstrap Flatly is chosen for the UI theme.

  4. Session is stored inside encrypted cookie.

  5. Static directory is located under/static.

  6. Model directory is located under/dal(Database Access Layer).

  7. It does not use ORM nor installs one.

  8. Test database is automatically created under$GO_BOOTSTRAP_PROJECT_NAME-test.

  9. A minimal Dockerfile is provided.

  10. A minimal Vagrantfile is provided.

  11. github.com/tools/godep is chosen to manage dependencies.

  12. github.com/jmoiron/sqlx is chosen to connect to a database.

  13. github.com/gorilla is chosen for a lot of the HTTP plumbings.

  14. github.com/carbocation/interpose is chosen as the middleware library.

  15. github.com/tylerb/graceful is chosen to enable graceful shutdown.

  16. github.com/mattes/migrate is chosen as the database migration tool.

  17. github.com/Sirupsen/logrus is chosen as the logging library.

項目主頁:http://www.baiduhome.net/lib/view/home/1431413590622

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!