server.go 1.3 KB
Newer Older
E
eoLinker API Management 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
package goku_node

import (
	log "github.com/eolinker/goku/goku-log"
	config_manager "github.com/eolinker/goku/goku-node/manager/config-manager"
	"github.com/eolinker/goku/goku-node/manager/updater"
	node_common "github.com/eolinker/goku/goku-node/node-common"
	monitor_write "github.com/eolinker/goku/server/monitor/monitor-write"

	goku_plugin "github.com/eolinker/goku-plugin"
	redis_plugin_proxy "github.com/eolinker/goku/goku-node/redis-plugin-proxy"

	"github.com/eolinker/goku/goku-service/discovery"
	"strings"
)



func InitPluginUtils() {
	goku_plugin.SetRedisManager(redis_plugin_proxy.Create())
	goku_plugin.InitLog(log.GetLogger())
	//goku_plugin.SetLog(new(log_plugin_proxy.LoggerGeneral))
}
func InitDiscovery() {

	all := discovery.AllDrivers()
	log.Infof("install service discovery driver:[%s]\n", strings.Join(all, ","))
}
func InitLog()  {
	config_manager.InitLog()
}
func InitServer(){
	log.Debug("init InitServer start")

	InitPluginUtils()

	log.Debug("init InitPluginUtils done")
	InitDiscovery()
	log.Debug("init InitDiscovery done")
	// 注册自动更新,并保证第一次全量拉取完数据
	updater.InitUpdate()

	//// 执行插件初始化函数
	// 插件初始化放在 plugin-manager中
	log.Debug("init updater.InitUpdate done")

	monitor_write.InitMonitorWrite(node_common.ClusterName())
	log.Debug("init server done")
}