sethvargo/go-limiter

How to use Store from redisstore on httplimit.NewMiddleware ?

FRHuda opened this issue · 4 comments

i need to create middleware from httplimit.NewMiddleware . but its func can't take store from redisstore.New because redisstore.New return store , not storeWithContext.

it happen in

github.com/sethvargo/go-limiter v0.4.1
github.com/sethvargo/go-redisstore v0.1.2

but i can use redisstore for httplimit.NewMiddleware in older version.

There's a runtime type assertion, so you can do something like store.(limiter.StoreWithContext)

Or wait for sethvargo/go-redisstore#5 to merge and release.

v0.1.3

This issue has been automatically locked since there has not been any
recent activity after it was closed. Please open a new issue for
related bugs.