auth_model.go 880 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package model
  2. import (
  3. "rocommon"
  4. "roserver/baseserver"
  5. "sync"
  6. )
  7. var (
  8. updateList []interface{}
  9. httpParamMutex sync.RWMutex
  10. HttpNodeParam *baseserver.ServiceParam
  11. authCheckMag *AuthCheckMag
  12. )
  13. type AuthUpdate struct {
  14. rocommon.UpdateModule //eventqueue.go
  15. }
  16. func (this *AuthUpdate) Init() {
  17. authCheckMag = NewAuthCheckMag()
  18. updateList = append(updateList, authCheckMag)
  19. }
  20. func (this *AuthUpdate) Update(ms uint64) {
  21. //对管理器进行更新操作
  22. for _, data := range updateList {
  23. data.(rocommon.UpdateLogic).Update(ms)
  24. }
  25. }
  26. func GetAuthCheckMag() *AuthCheckMag {
  27. return authCheckMag
  28. }
  29. func GetHttpNodeParam() baseserver.ServiceParam {
  30. httpParamMutex.RLock()
  31. defer httpParamMutex.RUnlock()
  32. return *HttpNodeParam
  33. }
  34. func SetHttpNodeParam(param *baseserver.ServiceParam) {
  35. httpParamMutex.Lock()
  36. defer httpParamMutex.Unlock()
  37. HttpNodeParam = param
  38. }