starter code
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package ratelimit
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
// GoRedis bridges *redis.Client to the ScriptRunner interface.
|
||||
//
|
||||
// Kept in its own file, and as thin as possible, because it is the one piece
|
||||
// here that cannot be exercised without a live Redis: everything in redis.go is
|
||||
// tested against a fake.
|
||||
type GoRedis struct {
|
||||
Client *redis.Client
|
||||
}
|
||||
|
||||
func (g GoRedis) Eval(ctx context.Context, script string, keys []string, args ...any) (any, error) {
|
||||
return g.Client.Eval(ctx, script, keys, args...).Result()
|
||||
}
|
||||
Reference in New Issue
Block a user