Documentation ¶
Index ¶
- Variables
- func EnsureAllIndex()
- func GetCol(dbName, col string) (session *mgo.Session, collection *mgo.Collection)
- func IsFinishInit() bool
- func IsMgoDup(err error) bool
- func IsMgoNotFound(err error) bool
- func MysqlExec(query string, args ...interface{}) (sql.Result, error)
- func MysqlInit(cfg *MysqlConfig)
- func MysqlQuery(query string, args ...interface{}) (*sql.Rows, error)
- func NewCollection(session *mgo.Session, dbName, name string) *mgo.Collection
- func NewObjectId() bson.ObjectId
- func NewSession() (session *mgo.Session)
- func ObjectIds(ids []string) (ret []bson.ObjectId)
- func SetOnEnsureIndex(f func())
- func SetOnFinishInit(f func())
- func Setup(c *MongoConfig)
- func ShareSession() *mgo.Session
- func TimeFormat(t time.Time) string
- func TimeParse(s string) time.Time
- func TimeParseLocalTime(s string) time.Time
- func TimeToLocalTime(c time.Time) string
- type M
- type MongoConfig
- type Mysql
- type MysqlConfig
- type QueryWrapper
- type Queryer
- type RedisStore
- type SqlServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOperaBeforeInit = errors.New("please set db.SetOnFinishInit when needed operating db in init()")
Functions ¶
func EnsureAllIndex ¶
func EnsureAllIndex()
func IsFinishInit ¶
func IsFinishInit() bool
func IsMgoNotFound ¶
func MysqlInit ¶
func MysqlInit(cfg *MysqlConfig)
func NewCollection ¶
func NewCollection(session *mgo.Session, dbName, name string) *mgo.Collection
func NewObjectId ¶
func NewSession ¶
func SetOnEnsureIndex ¶
func SetOnEnsureIndex(f func())
func SetOnFinishInit ¶
func SetOnFinishInit(f func())
func Setup ¶
func Setup(c *MongoConfig)
func ShareSession ¶
func TimeFormat ¶
func TimeParseLocalTime ¶
func TimeToLocalTime ¶
Types ¶
type MongoConfig ¶
type MysqlConfig ¶
type QueryWrapper ¶
type RedisStore ¶
func NewRedisStore ¶
func (*RedisStore) StringScan ¶
func (r *RedisStore) StringScan(str string, val interface{}) error
! functions
type SqlServer ¶
func GetSqlServer ¶
func (*SqlServer) AddQueryWrapper ¶
func (s *SqlServer) AddQueryWrapper(wrapper QueryWrapper)
Click to show internal directories.
Click to hide internal directories.