Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

106 lines
3.6 KiB
Go

package skdg
import (
"91porn-server/common/constant"
"91porn-server/common/db"
"91porn-server/common/elastic"
"91porn-server/common/redis"
"91porn-server/common/tg"
)
type GlobalConfig struct {
Base struct {
Port int64 `json:"port"`
Env string `json:"env"`
// 媒体分片(TS)鉴权签名密钥对象(含 keyVersion/key);未配置时回退内置默认(版本 default + constant.MediaSourceAuthKey)
TsAuth constant.TsAuthKeyConfig `json:"tsAuth"`
} `json:"base"`
Mongo struct {
VideoDbUrl string `json:"videoDbUrl"` //主数据库 存放强业务相关的数据
StatDbUrl string `json:"statDbUrl"` //统计数据库 存放统计 日志 渠道相关的数据
LogDbUrl string `json:"logDbUrl"` //日志数据库
SpiderDbUrl string `json:"spiderDbUrl"` //爬虫库
} `json:"mongo"`
Log struct {
Level string `json:"level"`
} `json:"log"`
Redis struct {
URL string `json:"url"`
} `json:"redis"`
ShortRecommend ShortRecommendConfig `json:"shortRecommend"`
DataReport struct {
Url string `json:"url"`
AppUrl string `json:"appUrl"`
} `json:"dataReport"`
DaiChong struct {
AppID string `json:"appId"`
AppSecret string `json:"appSecret"`
PlatName string `json:"platName"`
Domain string `json:"domain"`
} `json:"daichong"`
LSJ struct {
AppID string `json:"appId"`
APIKey string `json:"apiKey"`
APIUrl string `json:"apiUrl"`
ImageYuan string `json:"imageYuan"`
NoticeURL string `json:"noticeUrl"`
} `json:"lsj"`
Hevc struct {
EnableTranscode *bool `json:"enableTranscode"` // nil: 仅生产环境默认开启;true: 显式开启;false: 所有环境熔断
PullSecret string `json:"pullSecret"` // 与 App 共享的 H265 拉流签名密钥,至少 32 个随机字节
} `json:"hevc"`
AdCenter struct {
ApiDomain string `json:"apiDomain"` // api 地址
MerchantCode string `json:"merchantCode"` // 商户 code
AppCode string `json:"appCode"` // 应用 code
AesKey string `json:"aesKey"` // 数据解密 KEY
} `json:"adCenter"`
ImV2 struct {
BaseURL string `json:"baseUrl"`
DynamicConfigDomain string `json:"dynamicConfigDomain"`
SocketURL string `json:"socketUrl"`
MerchantCode string `json:"merchantCode"`
TenantCode string `json:"tenantCode"`
AppKey string `json:"appKey"`
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
} `json:"imv2"`
Elastic struct {
VideoUrl string `json:"videoUrl"`
UserName string `json:"userName"`
PassWord string `json:"passWord"`
} `json:"elastic"`
Url struct {
CheckUrl string `json:"checkUrl"`
SpiderDataURL string `json:"spiderDataUrl"` //统计中心数据同步域名
PullFileInfo string `json:"pullFileInfo"`
AiServer string `json:"aiServer"` //ai订单请求地址
AppApiUrl string `json:"appApiUrl"` // App 对外 HTTPS origin(无路径),供 H265 云转码拉取源 m3u8
} `json:"url"`
Switch struct {
NotifyExpire bool `json:"notifyExpire"`
} `json:"switch"`
StartDate string `json:"startDate"`
MediaResourcesCfg struct {
UploadMediaUrl string `json:"uploadMediaUrl"` // 请求域名
ProId string `json:"proId"` // 商户号
AppSecret string `json:"appSecret"` // 商户密钥
} `json:"mediaResourceCfg"` //媒体资源库配置
}
var (
Conf *GlobalConfig
Redis *redis.Client
VideoES *elastic.Client
Static *StaticSource
StatDB *db.MongoDB
VideoDB *db.MongoDB
LogDB *db.MongoDB
SpiderDB *db.MongoDB
Bot *tg.Bot
)
type StaticSource struct {
Portrait []string `json:"portrait"`
}