Documentation ¶
Index ¶
- Constants
- func NewdbMongo(dbtype, dbname string, cfg []byte) (*dbMongo, error)
- func NewdbSql(dbtype, dbname string, cfg []byte) (*dbSql, error)
- type DB
- func (db *DB) ExecWrapper(tables []interface{}, query string, args ...interface{}) (sql.Result, error)
- func (db *DB) GetWrapper(tables []interface{}, dest interface{}, query string, args ...interface{}) error
- func (db *DB) NamedExecWrapper(tables []interface{}, query string, arg interface{}) (sql.Result, error)
- func (db *DB) NamedQueryWrapper(tables []interface{}, query string, arg interface{}) (*sqlx.Rows, error)
- func (db *DB) QueryRowxWrapper(tables []interface{}, query string, args ...interface{}) *sqlx.Row
- func (db *DB) QueryxWrapper(tables []interface{}, query string, args ...interface{}) (*sqlx.Rows, error)
- func (db *DB) SelectWrapper(tables []interface{}, dest interface{}, query string, args ...interface{}) error
- type QueryStat
- type Router
- func (m *Router) MongoExecEventual(cluster, table string, query func(*mgo.Collection) error) error
- func (m *Router) MongoExecMonotonic(cluster, table string, query func(*mgo.Collection) error) error
- func (m *Router) MongoExecStrong(cluster, table string, query func(*mgo.Collection) error) error
- func (m *Router) RouterInfo(cluster, table string) string
- func (m *Router) SqlExec(cluster string, query func(*DB, []interface{}) error, tables ...string) error
- func (m *Router) SqlExecDeprecated(cluster, table string, query func(*sqlx.DB) error) error
- func (m *Router) StatInfo() []*QueryStat
- func (m *Router) String() string
Constants ¶
View Source
const ( DB_TYPE_MONGO = "mongo" DB_TYPE_MYSQL = "mysql" DB_TYPE_POSTGRES = "postgres" )
Variables ¶
This section is empty.
Functions ¶
func NewdbMongo ¶
Types ¶
type DB ¶
func (*DB) ExecWrapper ¶
func (*DB) GetWrapper ¶
func (*DB) NamedExecWrapper ¶
func (*DB) NamedQueryWrapper ¶
func (*DB) QueryRowxWrapper ¶
func (*DB) QueryxWrapper ¶
func (*DB) SelectWrapper ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) MongoExecEventual ¶
func (*Router) MongoExecMonotonic ¶
func (*Router) MongoExecStrong ¶
func (*Router) RouterInfo ¶
func (*Router) SqlExecDeprecated ¶
Click to show internal directories.
Click to hide internal directories.