Documentation ¶
Index ¶
- func Compare(a, b *DataInstance, showDiff bool) bool
- func CompareDataSet(base, current []*DataInstance, showSummary bool) bool
- func DumpSelectInfo(selectResult map[int64]int) bool
- type DBTestTool
- type DBTestToolMongo
- func (s *DBTestToolMongo) Clean() error
- func (s *DBTestToolMongo) Delete() ([]*DataInstance, error)
- func (s *DBTestToolMongo) Insert() ([]*DataInstance, error)
- func (s *DBTestToolMongo) Select(dataSet []*DataInstance) (map[int64]int, error)
- func (s *DBTestToolMongo) SetUp() error
- func (s *DBTestToolMongo) Update() ([]*DataInstance, error)
- type DBTestToolSqlConn
- func (s *DBTestToolSqlConn) Clean() error
- func (s *DBTestToolSqlConn) Delete() ([]*DataInstance, error)
- func (s *DBTestToolSqlConn) Insert() ([]*DataInstance, error)
- func (s *DBTestToolSqlConn) InsertBenchmarkCK() error
- func (s *DBTestToolSqlConn) InsertBenchmarkMySQL() error
- func (s *DBTestToolSqlConn) Select(dataSet []*DataInstance) (map[int64]int, error)
- func (s *DBTestToolSqlConn) SetUp() error
- func (s *DBTestToolSqlConn) Update() ([]*DataInstance, error)
- func (s *DBTestToolSqlConn) UpdateBenchmark() ([]*DataInstance, error)
- type DataInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare(a, b *DataInstance, showDiff bool) bool
func CompareDataSet ¶
func CompareDataSet(base, current []*DataInstance, showSummary bool) bool
func DumpSelectInfo ¶
Types ¶
type DBTestTool ¶
type DBTestTool interface { Insert() ([]*DataInstance, error) Clean() error SetUp() error Update() ([]*DataInstance, error) Delete() ([]*DataInstance, error) Select([]*DataInstance) (map[int64]int, error) }
func NewDBTestToolOnCK ¶
func NewDBTestToolOnCK(conn sqlx.SqlConn) DBTestTool
func NewDBTestToolOnCKQuery ¶
func NewDBTestToolOnCKQuery(conn sqlx.SqlConn) DBTestTool
func NewDBTestToolOnMongo ¶
func NewDBTestToolOnMongo(dataSource, collection string) DBTestTool
func NewDBTestToolOnMySQL ¶
func NewDBTestToolOnMySQL(dataSource string) DBTestTool
type DBTestToolMongo ¶
type DBTestToolMongo struct { Database string Collection string // contains filtered or unexported fields }
func (*DBTestToolMongo) Clean ¶
func (s *DBTestToolMongo) Clean() error
func (*DBTestToolMongo) Delete ¶
func (s *DBTestToolMongo) Delete() ([]*DataInstance, error)
func (*DBTestToolMongo) Insert ¶
func (s *DBTestToolMongo) Insert() ([]*DataInstance, error)
func (*DBTestToolMongo) Select ¶
func (s *DBTestToolMongo) Select(dataSet []*DataInstance) (map[int64]int, error)
func (*DBTestToolMongo) SetUp ¶
func (s *DBTestToolMongo) SetUp() error
func (*DBTestToolMongo) Update ¶
func (s *DBTestToolMongo) Update() ([]*DataInstance, error)
type DBTestToolSqlConn ¶
type DBTestToolSqlConn struct {
// contains filtered or unexported fields
}
func (*DBTestToolSqlConn) Clean ¶
func (s *DBTestToolSqlConn) Clean() error
func (*DBTestToolSqlConn) Delete ¶
func (s *DBTestToolSqlConn) Delete() ([]*DataInstance, error)
func (*DBTestToolSqlConn) Insert ¶
func (s *DBTestToolSqlConn) Insert() ([]*DataInstance, error)
func (*DBTestToolSqlConn) InsertBenchmarkCK ¶
func (s *DBTestToolSqlConn) InsertBenchmarkCK() error
func (*DBTestToolSqlConn) InsertBenchmarkMySQL ¶
func (s *DBTestToolSqlConn) InsertBenchmarkMySQL() error
func (*DBTestToolSqlConn) Select ¶
func (s *DBTestToolSqlConn) Select(dataSet []*DataInstance) (map[int64]int, error)
func (*DBTestToolSqlConn) SetUp ¶
func (s *DBTestToolSqlConn) SetUp() error
func (*DBTestToolSqlConn) Update ¶
func (s *DBTestToolSqlConn) Update() ([]*DataInstance, error)
func (*DBTestToolSqlConn) UpdateBenchmark ¶
func (s *DBTestToolSqlConn) UpdateBenchmark() ([]*DataInstance, error)
type DataInstance ¶
type DataInstance struct { PK int64 `db:"pk" bson:"pk"` IntValue int `db:"int_value" bson:"int_value"` FloatValue float32 `db:"float_value" bson:"float_value"` DoubleValue float64 `db:"double_value" bson:"double_value"` CharValue string `db:"char_value" bson:"char_value"` VarCharValue string `db:"varchar_value" bson:"varchar_value"` TimeValue time.Time `db:"time_value" bson:"time_value"` }
func GenerateDataSet ¶
func GenerateDataSet(num int) []*DataInstance
func UpdateDataSet ¶
func UpdateDataSet(dataSet []*DataInstance) []*DataInstance
Click to show internal directories.
Click to hide internal directories.