Casbin watcher implementation with Nats.io

Clone this repo:
  1. ea7d2ef Test coverage added (#2) by Alex · 8 years ago master
  2. f48adcd Update README.md by Alex · 8 years ago
  3. b371df0 Update README.md by Alex · 8 years ago
  4. 3992110 Update README.md by Alex · 8 years ago
  5. c04bab2 watcher implementation added (#1) by Alex · 8 years ago

casbin-nats-watcher

License: MIT Go Report Card Build Status Coverage Status Godoc

Casbin watcher implementation with Nats.io

Installation

go get github.com/Soluto/casbin-nats-watcher

Usage

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)
}

Related pojects

Additional Usage Examples

For real-world example visit Tweek.

License

This project is under MIT License. See the LICENSE file for the full license text.