Versions in this module Expand all Collapse all v1 v1.0.0 Dec 2, 2022 Changes in this version + func DefaultCallback(e casbin.IEnforcer) func(string) + type MSG struct + FieldIndex int + FieldValues []string + ID string + Method UpdateType + NewRules [][]string + OldRules [][]string + Ptype string + Sec string + type Option struct + Channel string + LocalID string + NotifySelf bool + Verbose bool + type UpdateType string + const Update + const UpdateForAddPolicies + const UpdateForAddPolicy + const UpdateForRemoveFilteredPolicy + const UpdateForRemovePolicies + const UpdateForRemovePolicy + const UpdateForSavePolicy + const UpdateForUpdatePolicies + const UpdateForUpdatePolicy + type Watcher struct + func NewWatcherWithConnString(ctx context.Context, connString string, opt Option) (*Watcher, error) + func NewWatcherWithPool(ctx context.Context, pool *pgxpool.Pool, opt Option) (*Watcher, error) + func (w *Watcher) Close() + func (w *Watcher) GetChannel() string + func (w *Watcher) GetLocalID() string + func (w *Watcher) GetNotifySelf() bool + func (w *Watcher) GetVerbose() bool + func (w *Watcher) SetUpdateCallback(callback func(string)) error + func (w *Watcher) Update() error + func (w *Watcher) UpdateForAddPolicies(sec string, ptype string, rules ...[]string) error + func (w *Watcher) UpdateForAddPolicy(sec, ptype string, params ...string) error + func (w *Watcher) UpdateForRemoveFilteredPolicy(sec, ptype string, fieldIndex int, fieldValues ...string) error + func (w *Watcher) UpdateForRemovePolicies(sec string, ptype string, rules ...[]string) error + func (w *Watcher) UpdateForRemovePolicy(sec, ptype string, params ...string) error + func (w *Watcher) UpdateForSavePolicy(model model.Model) error + func (w *Watcher) UpdateForUpdatePolicies(sec string, ptype string, oldRules, newRules [][]string) error + func (w *Watcher) UpdateForUpdatePolicy(sec string, ptype string, oldRule, newRule []string) error