This commit is contained in:
2025-06-13 17:23:16 +08:00
parent 3150ba80bc
commit 1b72f51e4a
55 changed files with 3894 additions and 310 deletions

19
internal/pkg/cache/cache.go vendored Normal file
View File

@@ -0,0 +1,19 @@
package cache
import (
"context"
"time"
"github.com/redis/go-redis/v9"
)
type Cache interface {
Encode(a any) ([]byte, error)
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
Del(ctx context.Context, keys ...string) error
Get(ctx context.Context, key string) (string, error)
GetBytes(ctx context.Context, key string) ([]byte, error)
Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd
Keys(ctx context.Context, pattern string) ([]string, error)
ListKeys(ctx context.Context, pattern string, pageID int, pageSize int) ([]string, int, error)
}