Files
token-go/persist/watcher.go
2023-05-05 22:45:47 +08:00

22 lines
870 B
Go

package persist
import "github.com/weloe/token-go/model"
// Watcher event watcher
type Watcher interface {
// Login called after login
Login(loginType string, id interface{}, tokenValue string, loginModel *model.Login)
// Logout called after logout
Logout(loginType string, id interface{}, tokenValue string)
// Kickout called when being kicked out of the server
Kickout(loginType string, id interface{}, tokenValue string)
// Replace called when Someone else has taken over your account
Replace(loginType string, id interface{}, tokenValue string)
// Ban called when account banned
Ban(loginType string, id interface{}, service string)
// UnBan called when account has been unbanned.
UnBan(loginType string, id interface{}, service string)
// RefreshToken called when renew token timeout
RefreshToken(tokenValue string, id interface{}, timeout int64)
}