mirror of
https://github.com/weloe/token-go.git
synced 2025-10-05 15:36:50 +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
|
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 {
|
func (e *Enforcer) GetLogger() log.Logger {
|
||||||
return e.logger
|
return e.logger
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,8 @@ package persist
|
|||||||
|
|
||||||
// UpdatableWatcher called when data updated
|
// UpdatableWatcher called when data updated
|
||||||
type UpdatableWatcher interface {
|
type UpdatableWatcher interface {
|
||||||
UpdateForSetStr(key string, value interface{}, timeout int64) error
|
UpdateForSetStr(key string, value string, timeout int64) error
|
||||||
UpdateForUpdateStr(key string, value interface{}) error
|
UpdateForUpdateStr(key string, value string) error
|
||||||
UpdateForSet(key string, value interface{}, timeout int64) error
|
UpdateForSet(key string, value interface{}, timeout int64) error
|
||||||
UpdateForUpdate(key string, value interface{}) error
|
UpdateForUpdate(key string, value interface{}) error
|
||||||
UpdateForDelete(key string) error
|
UpdateForDelete(key string) error
|
||||||
|
Reference in New Issue
Block a user