config.go 943 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package config
  2. import (
  3. "github.com/zeromicro/go-zero/core/stores/cache"
  4. "github.com/zeromicro/go-zero/rest"
  5. "github.com/zeromicro/go-zero/zrpc"
  6. )
  7. type CacheRedisConf struct {
  8. Nodes cache.CacheConf
  9. KeyPrefix string `json:",optional"`
  10. }
  11. type CapjsConf struct {
  12. Enable int64 `json:",optional"` // 1 启用,0 或未配置则禁用
  13. EndpointURL string `json:",optional"` // cap.js 服务地址,如 https://cap.example.com
  14. Key string `json:",optional"` // cap.js site key
  15. Secret string `json:",optional"` // cap.js site secret(用于服务端 siteverify)
  16. }
  17. type Config struct {
  18. rest.RestConf
  19. RpcServerConf zrpc.RpcServerConf
  20. MySQL struct {
  21. DataSource string
  22. }
  23. CacheRedis CacheRedisConf
  24. Auth struct {
  25. AccessSecret string
  26. AccessExpire int64
  27. RefreshSecret string
  28. RefreshExpire int64
  29. ManagementKey string
  30. }
  31. Capjs CapjsConf `json:",optional"`
  32. BehindProxy bool `json:",optional"`
  33. }