feat: Redis热数据+K线聚合+Dashboard MySQL指标修复
This commit is contained in:
1 parent
b8b1a3d5f6
commit
a843ab7b00
9 files changed
+311
-12
No files matched your search
@@ -34,6 +34,12 @@ type Config struct {
|
||||
DataDir string // redka 数据目录
|
||||
}
|
||||
|
||||
// SortedSetMember 有序集合成员 // Logan.Li
|
||||
type SortedSetMember struct {
|
||||
Score float64
|
||||
Member string
|
||||
}
|
||||
|
||||
// Cache Redis 缓存接口 // Logan.Li
|
||||
type Cache interface {
|
||||
Get(ctx context.Context, key string) (string, error)
|
||||
@@ -43,6 +49,11 @@ type Cache interface {
|
||||
Expire(ctx context.Context, key string, expiration time.Duration) error
|
||||
Ping(ctx context.Context) error
|
||||
Close() error
|
||||
|
||||
// 有序集合操作(热数据指标存储,仅 go-redis 后端完整支持)
|
||||
ZAdd(ctx context.Context, key string, member SortedSetMember) error
|
||||
ZRangeByScore(ctx context.Context, key string, min, max string) ([]SortedSetMember, error)
|
||||
ZRemRangeByScore(ctx context.Context, key string, min, max string) error
|
||||
}
|
||||
|
||||
// New 创建缓存实例(根据驱动自动选择后端)// Logan.Li
|
||||
|
||||
Reference in new issue
Block a user