Redis Adapter

Redis Adapter is the Redis adapter for Casbin. With this library, Casbin can load policy from Redis or save policy to it.
Installation
go get github.com/casbin/redis-adapter/v2
Simple Example
package main
import (
"github.com/casbin/casbin/v2"
"github.com/casbin/redis-adapter/v2"
)
func main() {
a := redisadapter.NewAdapter("tcp", "127.0.0.1:6379")
e := casbin.NewEnforcer("examples/rbac_model.conf", a)
e.LoadPolicy()
e.Enforce("alice", "data1", "read")
e.SavePolicy()
}
Getting Help
License
This project is under Apache 2.0 License. See the LICENSE file for the full license text.