config.go 697 B

1234567891011121314151617181920212223242526272829303132
  1. package config
  2. import (
  3. "github.com/zeromicro/go-zero/core/conf"
  4. "github.com/zeromicro/go-zero/zrpc"
  5. )
  6. type Config struct {
  7. zrpc.RpcServerConf
  8. Node int // 节点
  9. CalleeId string // 服务名字
  10. FileSystemConf zrpc.RpcClientConf
  11. Mysql Mysql
  12. ResourceEtcdConf zrpc.RpcClientConf //资源中台
  13. }
  14. var (
  15. ConfigJson Config
  16. )
  17. type Mysql struct {
  18. DbName string `json:"dbName"`
  19. Address string `json:"address"`
  20. UserName string `json:"userName"`
  21. PassWord string `json:"passWord"`
  22. MaxOpenConns int `json:"maxOpenConns"`
  23. MaxIdleConns int `json:"maxIdleConns"`
  24. }
  25. func init() {
  26. conf.MustLoad("etc/usercenter.yaml", &ConfigJson)
  27. }