starter code

This commit is contained in:
2026-09-06 15:15:21 +02:00
parent 445acb18da
commit 1aa524fb22
10 changed files with 1094 additions and 0 deletions
+20
View File
@@ -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()
}