config_rocketmq.go 349 B

1234567891011121314151617181920
  1. package config
  2. var (
  3. _rocketmqConfig *RocketmqConfig
  4. )
  5. type RocketmqConfig struct {
  6. Url string `yaml:"url,omitempty"`
  7. Port int `yaml:"port,omitempty"`
  8. }
  9. func InitRocketmq(path string) {
  10. var config RocketmqConfig
  11. readConfig(path, &config)
  12. _rocketmqConfig = &config
  13. }
  14. func GetRocketmqConfig() RocketmqConfig {
  15. return *_rocketmqConfig
  16. }