You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
redis is a very popular storage system. Since version v0.3 there is support for redis session and user backend.
Quickstart Example
...import"github.com/go-redis/redis"client:=redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password setDB: 0, // use default DB
})
redisHandler:=goauth.NewRedisSessionHandler(client)
controller:=goauth.NewSessionController(redisHandler)
Then use it as you're used to. You should read the doc first however.
When you're using redis you don't need take care to delete invalid keys, redis will do this for you already.
If you use a different type than uint64 as your key type for users you should define a different ConvertUser function.
To manage users simply do
...import"github.com/go-redis/redis"client:=redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password setDB: 0, // use default DB
})
h:=goauth.NewRedisUserHandler(client, nil)