File tree Expand file tree Collapse file tree 4 files changed +153
-90
lines changed
Expand file tree Collapse file tree 4 files changed +153
-90
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Etcd Watcher is the [Etcd](https://github.com/coreos/etcd) watcher for [Casbin](
55
66## Installation
77
8- go get github.com/casbin/etcd-watcher
8+ go get github.com/casbin/etcd-watcher/v2
99
1010## Simple Example
1111
@@ -15,8 +15,8 @@ package main
1515import (
1616 " log"
1717
18- " github.com/casbin/casbin"
19- " github.com/casbin/etcd-watcher"
18+ casbin " github.com/casbin/casbin/v2 "
19+ etcdwatcher " github.com/casbin/etcd-watcher/v2 "
2020)
2121
2222func updateCallback (rev string ) {
@@ -26,7 +26,7 @@ func updateCallback(rev string) {
2626func main () {
2727 // Initialize the watcher.
2828 // Use the endpoint of etcd cluster as parameter.
29- w , _ := etcdwatcher.NewWatcher (" http://127.0.0.1:2379" )
29+ w , _ := etcdwatcher.NewWatcher ([] string { " http://127.0.0.1:2379" }, " keyname " )
3030
3131 // Initialize the enforcer.
3232 e , _ := casbin.NewEnforcer (" examples/rbac_model.conf" , " examples/rbac_policy.csv" )
Original file line number Diff line number Diff line change 1- module github.com/casbin/etcd-watcher
1+ module github.com/casbin/etcd-watcher/v2
22
33go 1.16
44
55require (
66 github.com/casbin/casbin/v2 v2.30.2
7- github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 // indirect
8- github.com/coreos/etcd v3.3.25+incompatible // indirect
9- github.com/coreos/go-semver v0.3.0 // indirect
10- github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
11- github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
12- github.com/envoyproxy/go-control-plane v0.9.5 // indirect
13- github.com/gogo/protobuf v1.3.2 // indirect
14- github.com/golang/protobuf v1.5.2 // indirect
15- github.com/google/uuid v1.2.0 // indirect
16- github.com/stretchr/testify v1.5.1 // indirect
17- go.etcd.io/etcd v3.3.25+incompatible
18- go.uber.org/zap v1.16.0 // indirect
19- google.golang.org/grpc v1.26.0 // indirect; updating this breaks etcd
7+ go.etcd.io/etcd/api/v3 v3.5.0
8+ go.etcd.io/etcd/client/v3 v3.5.0
209)
You can’t perform that action at this time.
0 commit comments