/casbin-nats-watcher

Casbin watcher implementation with Nats.io

Primary LanguageGoMIT LicenseMIT

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.