yiigo - Golang常用優秀庫封裝,用於API、WEB和爬蟲開發

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。[yiigo](https://github.com/IIInsomnia/yiigo)===Go常用優秀庫封裝,用於API、WEB和爬蟲開發## 特點* 支援多 [MySQL](https://github.com/jmoiron/sqlx) 串連* 支援多 [mongo](http://labix.org/mgo) 串連* 支援多 [redis](https://github.com/garyburd/redigo) 串連* 採用 [zap](https://github.com/uber-go/zap) 日誌記錄* 採用 [toml](https://github.com/pelletier/go-toml) 設定檔* 採用 [glide](https://glide.sh) 管理依賴包* 支援 [gomail](https://github.com/go-gomail/gomail) 郵件發送* 支援爬蟲類比登入## 擷取```shell# 初始化glide init# 擷取 yiigoglide get github.com/iiinsomnia/yiigo```## 使用#### 1、import yiigo```gopackage mainimport "github.com/iiinsomnia/yiigo"func main() { // 啟用 mysql、mongo、redis err := yiigo.Bootstrap(true, true, true) if err != nil { yiigo.Logger.Panic(err.Error()) } // coding...}```#### 2、resolve dependencies```shell# 擷取 yiigo 所需依賴包glide update```## 文檔* [API Reference](https://godoc.org/github.com/IIInsomnia/yiigo)* [Example](https://github.com/IIInsomnia/yiigo-example)## 說明* 在 `main.go` 所在目錄建立 `env.toml` 設定檔,具體配置可以參考 `env.toml.example`* `MySQL`、`mongo`、`redis` 多串連配置參考 `env.toml.example` 中的多資料庫配置部分(注釋部分)* `golang.org` 上 `go get` 不下來的庫,可以在這裡[擷取](https://github.com/golang)* 如爬蟲不需要類比登入,則只需要使用 [goquery](https://github.com/PuerkitoBio/goquery) 即可529 次點擊  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.