示例#1
0
文件: haproxy.go 项目: rthomas/bamboo
func GetTemplateData(config *conf.Configuration, conn *zk.Conn) interface{} {

	apps, _ := marathon.FetchApps(config.Marathon.Endpoint)
	services, _ := service.All(conn, config.Bamboo.Zookeeper)

	return templateData{apps, services}
}
示例#2
0
func GetTemplateData(config *conf.Configuration, conn *zk.Conn) interface{} {
	log.Println("Enter>> GetTemplateData")
	apps, _ := marathon.FetchApps(config.Marathon)
	services, _ := service.All(conn, config.Bamboo.Zookeeper)
	log.Println("EXIT<< GetTemplateData")
	return templateData{apps, services}
}
示例#3
0
文件: service.go 项目: ycaihua/bamboo
func (d *ServiceAPI) All(w http.ResponseWriter, r *http.Request) {
	services, err := service.All(d.Zookeeper, d.Config.Bamboo.Zookeeper)

	if err != nil {
		responseError(w, err.Error())
		return
	}

	responseJSON(w, services)
}
示例#4
0
func GetTemplateData(config *conf.Configuration, conn *zk.Conn) (*templateData, error) {

	apps, err := marathon.FetchApps(config.Marathon, config)

	if err != nil {
		return nil, err
	}

	services, err := service.All(conn, config.Bamboo.Zookeeper)

	if err != nil {
		return nil, err
	}

	return &templateData{apps, services}, nil
}
示例#5
0
func GetTemplateData(config *conf.Configuration, conn *zk.Conn) (interface{}, error) {

	apps, err := marathon.FetchApps(config.Marathon)

	if err != nil {
		return nil, err
	}

	services, err := service.All(conn, config.Bamboo.Zookeeper)

	if err != nil {
		return nil, err
	}

	env := make(map[string]string)
	for _, i := range os.Environ() {
		sep := strings.Index(i, "=")
		env[i[0:sep]] = i[sep+1:]
	}

	return templateData{apps, services, env}, nil
}