46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
// ================================================================================
|
||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||
// You can delete these comments if you wish manually maintain this interface file.
|
||
// ================================================================================
|
||
|
||
package service
|
||
|
||
import (
|
||
"context"
|
||
)
|
||
|
||
type (
|
||
IGameKv interface {
|
||
// SavesV1 方法
|
||
//
|
||
// @Description: 保存用户KV数据列表。
|
||
// @receiver s: sGameKv的实例。
|
||
// @return err: 错误信息,如果操作成功,则为nil。
|
||
SavesV1() (err error)
|
||
// 删除缓存key
|
||
DelCacheKey(ctx context.Context, uid int64)
|
||
// SavesV2Batch 批量保存游戏KV数据 (优化版)
|
||
//
|
||
// @Description: 使用批量Redis MGET和批量数据库操作提升性能
|
||
// @param ctx context.Context: 上下文对象
|
||
// @param cacheKeys []string: 缓存键列表
|
||
// @return err error: 返回错误信息
|
||
SavesV2Batch(ctx context.Context, cacheKeys []string) (err error)
|
||
}
|
||
)
|
||
|
||
var (
|
||
localGameKv IGameKv
|
||
)
|
||
|
||
func GameKv() IGameKv {
|
||
if localGameKv == nil {
|
||
panic("implement not found for interface IGameKv, forgot register?")
|
||
}
|
||
return localGameKv
|
||
}
|
||
|
||
func RegisterGameKv(i IGameKv) {
|
||
localGameKv = i
|
||
}
|