go.mod update priv git url
This commit is contained in:
38
redis/cache.go
Normal file
38
redis/cache.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package redis
|
||||
|
||||
// import (
|
||||
// "context"
|
||||
// "strconv"
|
||||
// "time"
|
||||
|
||||
// "github.com/go-redis/redis/v8"
|
||||
// )
|
||||
|
||||
// func NewCache(host string, port int, password string) *redis.Client {
|
||||
// redis := redis.NewClient(&redis.Options{
|
||||
// Addr: host + ":" + strconv.Itoa(port),
|
||||
// Password: password,
|
||||
// DB: 0,
|
||||
// })
|
||||
// defer redis.Close()
|
||||
|
||||
// return redis
|
||||
// }
|
||||
|
||||
// func Get(ctx context.Context, key string) (float64, error) {
|
||||
// // ctx := context.Background() // FIXME
|
||||
// price, err := s.cache.Get(ctx, key).Float64()
|
||||
// if err != nil {
|
||||
// s.log.Log("cache read error(key not exists): %#v", err)
|
||||
// return 0, err
|
||||
// }
|
||||
|
||||
// return price, nil
|
||||
// }
|
||||
|
||||
// func Set(ctx context.Context, key string, value any, exp time.Duration) error {
|
||||
// // ctx := context.Background() // FIXME
|
||||
// s.cache.Set(ctx, key, value, exp)
|
||||
|
||||
// return nil
|
||||
// }
|
||||
Reference in New Issue
Block a user