Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConfig ¶
type DBConfig struct { Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` Host string `yaml:"host"` Port int `yaml:"port"` MaxIdleConns int `yaml:"max_idle_conns"` MaxOpenConns int `yaml:"max_open_conns"` }
DBConfig db config
func (*DBConfig) SerialSource ¶
func (*DBConfig) SourceUTF8 ¶
SourceUTF8 备注旧版本数据库使用UTF8编码,以及时区用UTC 0时区,跟本地时区相差8小时,这里要特别注意
type DBInfo ¶
func (*DBInfo) Begin ¶
func (dbInfo *DBInfo) Begin(trans *Transaction, objects ...TransactionObject) (*Transaction, error)
type MongoDBConfig ¶
type MongoDBConfig struct { Address []string `yaml:"address"` Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` PoolLimit int `yaml:"pool_limit"` }
MongoDBConfig mongo db config
type Transaction ¶
type Transaction struct { *gorp.Transaction // contains filtered or unexported fields }
func (*Transaction) AddObject ¶
func (trans *Transaction) AddObject(o TransactionObject)
func (*Transaction) Commit ¶
func (trans *Transaction) Commit() error
func (*Transaction) Rollback ¶
func (trans *Transaction) Rollback() error
type TransactionObject ¶
type TransactionObject interface {
SetTransaction(trans *Transaction)
}
Click to show internal directories.
Click to hide internal directories.