config.go 456 字节
package configs

import (
	"os"
	"strings"
)

type MqConfig struct {
	Servers    []string `json:"servers"`
	ConsumerId string   `json:"consumerGroup"`
}

var Cfg MqConfig

func init() {

	Cfg = MqConfig{
		Servers:    []string{"106.52.15.41:9092"},
		ConsumerId: "partnermg",
	}
	if os.Getenv("KAFKA_HOST") != "" {
		kafkaHost := os.Getenv("KAFKA_HOST")
		Cfg.Servers = strings.Split(kafkaHost, ";")
	}
}

// "192.168.190.136:9092",
// "106.52.15.41:9092"