审查视图

pkg/constant/kafka.go 774 字节
yangfu authored
1 2 3 4 5 6
package constant

import "os"

var (
	// kafka 地址
yangfu authored
7
	KAFKA_HOST = "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092" // "106.75.231.90:9092"
yangfu authored
8 9 10 11
	// kafka  topic log stash
	TOPIC_LOG_STASH = "go_stash_dev"
	// 是否启用日志收集 (本地不启用)
	ENABLE_KAFKA_LOG = false
yangfu authored
12
	//  kafka  topic up_block_chain
yangfu authored
13
	TOPIC_UP_BLOCK_CHAIN = "allied_creation_message"
yangfu authored
14 15 16
)

func init() {
yangfu authored
17 18 19
	if os.Getenv("KAFKA_HOST") != "" {
		KAFKA_HOST = os.Getenv("KAFKA_HOST")
	}
yangfu authored
20 21 22 23
	//if os.Getenv("TOPIC_LOG_STASH") != "" {
	//	POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH")
	//}
	if os.Getenv("ENABLE_KAFKA_LOG") != "" {
陈志颖 authored
24 25 26 27 28
		if os.Getenv("ENABLE_KAFKA_LOG") == "true" {
			ENABLE_KAFKA_LOG = true
		} else if os.Getenv("ENABLE_KAFKA_LOG") == "false" {
			ENABLE_KAFKA_LOG = false
		}
yangfu authored
29 30
	}
}