mirror of
https://github.com/weloe/token-go.git
synced 2025-10-05 23:46:52 +08:00
feat: add enforcer field Set Get
This commit is contained in:
@@ -154,6 +154,14 @@ func (e *Enforcer) SetWatcher(watcher persist.Watcher) {
|
||||
e.watcher = watcher
|
||||
}
|
||||
|
||||
func (e *Enforcer) SetUpdatableWatcher(watcher persist.UpdatableWatcher) {
|
||||
e.updatableWatcher = watcher
|
||||
}
|
||||
|
||||
func (e *Enforcer) GetUpdatableWatcher() persist.UpdatableWatcher {
|
||||
return e.updatableWatcher
|
||||
}
|
||||
|
||||
func (e *Enforcer) GetLogger() log.Logger {
|
||||
return e.logger
|
||||
}
|
||||
|
@@ -2,8 +2,8 @@ package persist
|
||||
|
||||
// UpdatableWatcher called when data updated
|
||||
type UpdatableWatcher interface {
|
||||
UpdateForSetStr(key string, value interface{}, timeout int64) error
|
||||
UpdateForUpdateStr(key string, value interface{}) error
|
||||
UpdateForSetStr(key string, value string, timeout int64) error
|
||||
UpdateForUpdateStr(key string, value string) error
|
||||
UpdateForSet(key string, value interface{}, timeout int64) error
|
||||
UpdateForUpdate(key string, value interface{}) error
|
||||
UpdateForDelete(key string) error
|
||||
|
Reference in New Issue
Block a user