config.go 465 B

123456789101112131415161718192021222324252627282930
  1. package config
  2. import (
  3. "github.com/tal-tech/go-zero/zrpc"
  4. )
  5. type Config struct {
  6. zrpc.RpcServerConf
  7. DataSource *mysqlConfig // 手动代码
  8. Mysql string
  9. Redis *RedisConfig
  10. SurvivalTime int
  11. }
  12. type RedisConfig struct {
  13. Host string
  14. Addr string
  15. Modules string
  16. }
  17. type mysqlConfig struct {
  18. DbName string
  19. Address string
  20. UserName string
  21. PassWord string
  22. MaxOpenConns int
  23. MaxIdleConns int
  24. }
  25. var ConfigJson Config