config.go 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Copyright (c) 2022 Yansen Zhang
  3. * wxcomponent is licensed under Mulan PSL v2.
  4. * You can use this software according to the terms and conditions of the Mulan PSL v2.
  5. * You may obtain a copy of Mulan PSL v2 at:
  6. * http://license.coscl.org.cn/MulanPSL2
  7. * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  8. * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  9. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  10. * See the Mulan PSL v2 for more details.
  11. **/
  12. package config
  13. import (
  14. "time"
  15. )
  16. type Config interface {
  17. // GetAppID 获取平台 APPID
  18. GetAppID() string
  19. // GetAppSecret 获取平台 APPSECRET
  20. GetAppSecret() string
  21. // GetAppSecret 获取平台消息校验Token
  22. GetMsgToken() string
  23. // GetToken 获取 Token
  24. GetAccessToken() string
  25. // RefreshToken 刷新 Token
  26. RefreshToken(token string, expire time.Time) error
  27. // GetTicket 获取票据
  28. GetVerifyTicket() string
  29. // RefreshTicket 刷新票据
  30. RefreshVerifyTicket(ticket string, expire time.Time) error
  31. // GetPushTicketState 是否开启票据推送服务
  32. GetPushTicketState() bool
  33. // RefreshPushTicketState 刷新票据推送服务状态
  34. RefreshPushTicketState(state bool)
  35. }
  36. var conf Config