You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
683 B
37 lines
683 B
package migrate |
|
|
|
import ( |
|
"context" |
|
"go-common/app/job/live/push-search/conf" |
|
"go-common/library/database/hbase.v2" |
|
"go-common/library/database/sql" |
|
) |
|
|
|
// Dao dao |
|
type Dao struct { |
|
c *conf.Config |
|
SearchHBase *hbase.Client |
|
RoomDb *sql.DB |
|
} |
|
|
|
// New init mysql db |
|
func NewMigrate(c *conf.Config) (dao *Dao) { |
|
dao = &Dao{ |
|
c: c, |
|
SearchHBase: hbase.NewClient(&c.SearchHBase.Config), |
|
RoomDb: sql.NewMySQL(c.MySQL), |
|
} |
|
return |
|
} |
|
|
|
// Close close the resource. |
|
func (d *Dao) Close() { |
|
d.RoomDb.Close() |
|
return |
|
} |
|
|
|
// Ping dao ping |
|
func (d *Dao) Ping(c context.Context) error { |
|
// TODO: if you need use mc,redis, please add |
|
return nil |
|
}
|
|
|