Casbin watcher implementation with Nats.io
go get github.com/Soluto/casbin-nats-watcher
import (
natswatcher "github.com/Soluto/casbin-nats-watcher"
"github.com/casbin/casbin"
)
func main() {
watcher, _ := natswatcher.NewWatcher("http://nats-endpoint", "my-policy-subject")
enforcer := casbin.NewSyncedEnforcer("model.conf", "policy.csv")
enforcer.SetWatcher(watcher)
}
For real-world example visit Tweek.
This project is under MIT License. See the LICENSE file for the full license text.