You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
package ckey
|
|
|
|
import "fmt"
|
|
|
|
const (
|
|
ProjectPrefix = "joybuywork:" //项目前缀
|
|
|
|
RedisTableFormat = ProjectPrefix + "redis_table:%s" //redis_table组件缓存format
|
|
|
|
TaskPrefix = ProjectPrefix + "task:"
|
|
|
|
CronPrefix = ProjectPrefix + "cron:"
|
|
|
|
User = ProjectPrefix + "user:" //用户模块前缀
|
|
|
|
Project = ProjectPrefix + "project:" //项目模块前缀
|
|
|
|
Company = ProjectPrefix + "company:" //企业模块前缀
|
|
|
|
Fission = ProjectPrefix + "fission:" //玩法模块前缀
|
|
|
|
Export = ProjectPrefix + "export:" // 导出任务
|
|
|
|
SubLock = ProjectPrefix + "sublock:" // 关注锁
|
|
|
|
DataCache = ProjectPrefix + "data_cache:" // 临时数据缓存
|
|
|
|
Delay = ProjectPrefix + "delay:" // 延时对列
|
|
|
|
Mall = ProjectPrefix + "mall:" //兑换商城模块前缀
|
|
|
|
ProjectUser = ProjectPrefix + "project_user:" //项目用户模块前缀
|
|
|
|
Game = ProjectPrefix + "game:" //游戏模块前缀
|
|
)
|
|
|
|
// ForLock 用来做临时锁
|
|
func ForLock(key string) string {
|
|
return key + ":for_lock"
|
|
}
|
|
|
|
// RedisTableKey redis_table组件hash key名称
|
|
func RedisTableKey(key string) string {
|
|
return fmt.Sprintf(RedisTableFormat, key)
|
|
}
|
|
|
|
// ExportKey 导出的缓存key
|
|
func ExportKey(hashMark string) string {
|
|
return fmt.Sprintf("%s%s", Export, hashMark)
|
|
}
|
|
|
|
func SubLockCommon() string {
|
|
return fmt.Sprintf("%scommon", SubLock)
|
|
}
|