mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-02-19 00:54:41 +08:00
init
This commit is contained in:
70
server/config/DataConfig.go
Normal file
70
server/config/DataConfig.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
/*
|
||||
定义一些数据库存放的key值
|
||||
*/
|
||||
const (
|
||||
|
||||
// CategoryTreeKey 分类树 key
|
||||
CategoryTreeKey = "CategoryTree"
|
||||
CategoryTreeExpired = time.Hour * 24 * 90
|
||||
// MovieListInfoKey movies分类列表 key
|
||||
MovieListInfoKey = "MovieList:Cid%d"
|
||||
// MAXGoroutine max goroutine, 执行spider中对协程的数量限制
|
||||
MAXGoroutine = 6
|
||||
// MovieDetailKey movie detail影视详情信息 可以
|
||||
MovieDetailKey = "MovieDetail:Cid%d:Id%d"
|
||||
// MovieBasicInfoKey 影片基本信息, 简略版本
|
||||
MovieBasicInfoKey = "MovieBasicInfoKey:Cid%d:Id%d"
|
||||
|
||||
// SearchCount Search scan 识别范围
|
||||
SearchCount = 3000
|
||||
// SearchKeys Search Key Hash
|
||||
SearchKeys = "SearchKeys"
|
||||
// SearchScoreListKey 根据评分检索的key
|
||||
SearchScoreListKey = "Search:SearchScoreList"
|
||||
SearchTimeListKey = "Search:SearchTimeList"
|
||||
SearchHeatListKey = "Search:SearchHeatList"
|
||||
// SearchInfoTemp redis暂存检索数据信息
|
||||
SearchInfoTemp = "Search:SearchInfoTemp"
|
||||
|
||||
// CornMovieUpdate 影片更新定时任务间隔
|
||||
CornMovieUpdate = "0 0/20 * * * ?"
|
||||
// UpdateInterval 获取最近几小时更新的影片 (h 小时) 默认3小时
|
||||
UpdateInterval = "3"
|
||||
// CornUpdateAll 每月28执行一次清库更新
|
||||
CornUpdateAll = "0 0 2 28 * ?"
|
||||
|
||||
// SpiderCipher 设置Spider触发指令
|
||||
SpiderCipher = "Life in a different world from zero"
|
||||
)
|
||||
|
||||
const (
|
||||
/*
|
||||
mysql服务配置信息
|
||||
*/
|
||||
MysqlDsn = "root:root@(192.168.20.10:3307)/FilmSite?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
/*
|
||||
docker compose 环境下的链接信息
|
||||
mysql:3306 为 docker compose 中 mysql服务对应的网络名称和端口
|
||||
UserName:Password 设置mysql账户的用户名和密码
|
||||
*/
|
||||
//MysqlDsn = "UserName:Password@(mysql:3306)/FilmSite?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
|
||||
/*
|
||||
redis 配置信息
|
||||
RedisAddr host:port
|
||||
RedisPassword redis访问密码
|
||||
RedisDBNo 使用第几号库
|
||||
*/
|
||||
RedisAddr = `192.168.20.10:6379`
|
||||
RedisPassword = `root`
|
||||
RedisDBNo = 0
|
||||
|
||||
// docker compose 环境下运行如下配置信息
|
||||
//RedisAddr = `redis:6379`
|
||||
//RedisPassword = `Password`
|
||||
//RedisDBNo = 0
|
||||
)
|
||||
Reference in New Issue
Block a user