[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
# 获取 yiigo
glide get github.com/iiinsomnia/yiigo
```
## 使用
#### 1、import yiigo
```go
package main
import "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) 即可
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,免费领全套学习资料或添加微信:muxilin131420 备注:入群;或加QQ群:729884609
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传