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.
34 lines
528 B
34 lines
528 B
package track |
|
|
|
import ( |
|
"time" |
|
|
|
"go-common/app/admin/main/videoup/conf" |
|
"go-common/library/cache/redis" |
|
"go-common/library/database/sql" |
|
) |
|
|
|
// Dao is track dao. |
|
type Dao struct { |
|
c *conf.Config |
|
// db |
|
db *sql.DB |
|
// redis |
|
redis *redis.Pool |
|
expire int32 |
|
} |
|
|
|
var ( |
|
d *Dao |
|
) |
|
|
|
// New new a dao. |
|
func New(c *conf.Config) (d *Dao) { |
|
d = &Dao{ |
|
c: c, |
|
db: sql.NewMySQL(c.DB.Archive), |
|
redis: redis.NewPool(c.Redis.Track.Config), |
|
expire: int32(time.Duration(c.Redis.Track.Expire) / time.Second), |
|
} |
|
return d |
|
}
|
|
|