SetUpdateCallback sets the callback function that the watcher will call when the policy in DB has been changed by other instances. A classic callback is Enforcer.LoadPolicy().
(func(string))
| 20 | // when the policy in DB has been changed by other instances. |
| 21 | // A classic callback is Enforcer.LoadPolicy(). |
| 22 | SetUpdateCallback(func(string)) error |
| 23 | // Update calls the update callback of other instances to synchronize their policy. |
| 24 | // It is usually called after changing the policy in DB, like Enforcer.SavePolicy(), |
| 25 | // Enforcer.AddPolicy(), Enforcer.RemovePolicy(), etc. |
no outgoing calls