Documentation ¶
Index ¶
- Constants
- func BaiduCity(ak, remoteAddr string, lat, lng float64) (string, string, string)
- func BaiduLoc(ak, city string) (float64, float64)
- func PushNSQ(server, topic string, body interface{}) *nsq.Producer
- func QQUserInfo(appID, accessToken, openID string) map[string]interface{}
- func QiniuRatio(qnURL, pic string) float64
- func WechatJSCode(jsCode, appID, secret string) map[string]interface{}
- func WechatUserInfo(accessToken, openID string) map[string]interface{}
- func WeiboUserInfo(accessToken, uid string) map[string]interface{}
- type DAO
- func (db *DAO) FindAll(dbName, collName string, query bson.M, skip, limit int, sort []string) []bson.M
- func (db *DAO) FindAllSelector(dbName, collName string, query, selector bson.M, skip, limit int, ...) []bson.M
- func (db *DAO) FindByGroup(dbName, collName string, match, group, sort bson.M, skip, limit int) []bson.M
- func (db *DAO) FindOne(dbName, collName string, selector, query bson.M) bson.M
- func (db *DAO) IncDo(dbName, collName string, selector, data bson.M) error
- func (db *DAO) InsertDo(dbName, collName string, data bson.M) (bson.ObjectId, error)
- func (db *DAO) InsertDoID(dbName, collName string, id bson.ObjectId, data bson.M) error
- func (db *DAO) RemoveAll(dbName, collName string, selector bson.M)
- func (db *DAO) RowsCount(dbName, collName string, query bson.M) int
- func (db *DAO) UpdateAllDo(dbName, collName string, selector, data bson.M) (int, error)
- func (db *DAO) UpdateAllNoSet(dbName, collName string, selector, data bson.M) (int, error)
- func (db *DAO) UpdateDo(dbName, collName string, selector, data bson.M) error
- func (db *DAO) UpdateNoSet(dbName, collName string, selector, data bson.M) error
- func (db *DAO) UpsertByID(dbName, collName string, id interface{}, data bson.M) error
- func (db *DAO) UpsertDo(dbName, collName string, selector, data bson.M) error
- type Easemob
- type IPAddressInfo
- type SlackUtil
Constants ¶
const ERRSTR string = "error"
ERRSTR 错误代码字符串
Variables ¶
This section is empty.
Functions ¶
func PushNSQ ¶
func PushNSQ(server, topic string, body interface{}) *nsq.Producer
PushNSQ 推送到NSQ消息队列中
func QQUserInfo ¶
QQUserInfo 通过 QQ 接口,获取用户资料 @appID @accessToken @openID
func WechatJSCode ¶
WechatJSCode 通过微信接口,用户CODE,获取open_id等数据 @jsCode @appID @secret
func WechatUserInfo ¶
WechatUserInfo 通过微信接口,获取用户资料 @accessToken @openID https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID
func WeiboUserInfo ¶
WeiboUserInfo 获取微博用户数据 @accessToken @uid
Types ¶
type DAO ¶
type DAO struct {
Session *mgo.Session
}
DAO 数据操作
func (*DAO) FindAll ¶
func (db *DAO) FindAll(dbName, collName string, query bson.M, skip, limit int, sort []string) []bson.M
FindAll 查询操作
func (*DAO) FindAllSelector ¶
func (db *DAO) FindAllSelector(dbName, collName string, query, selector bson.M, skip, limit int, sort []string) []bson.M
FindAllSelector 查询操作
func (*DAO) FindByGroup ¶
func (db *DAO) FindByGroup(dbName, collName string, match, group, sort bson.M, skip, limit int) []bson.M
FindByGroup 聚合查询
func (*DAO) InsertDoID ¶
InsertDoID 插入操作,带有新的ID
func (*DAO) UpdateAllDo ¶
UpdateAllDo 更新全部操作
func (*DAO) UpdateAllNoSet ¶
UpdateAllNoSet 更新全部插入操作
func (*DAO) UpdateNoSet ¶
UpdateNoSet 更新插入操作
func (*DAO) UpsertByID ¶
UpsertByID 更新插入操作
type Easemob ¶
Easemob 环信
func (*Easemob) EasemobNickModify ¶
EasemobNickModify 环信修改用户昵称 @userName @passwd @nickName @aToken
func (*Easemob) EasemobSignupSingle ¶
EasemobSignupSingle 环信注册单个用户 @uid @passwd @nickName
type IPAddressInfo ¶
type IPAddressInfo struct { Country string `json:"country"` CountryCode string `json:"countryCode"` Region string `json:"region"` RegionName string `json:"regionName"` City string `json:"city"` ISP string `json:"isp"` }
IPAddressInfo IP 地址信息
func IP2Adress ¶
func IP2Adress(ip string) (IPAddressInfo, error)
IP2Adress IP地址转换为物理地址 ip-api.com http://ip-api.com/json/113.116.28.98?lang=zh-CN