update.go 517 字节
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
package handler

import (
	"encoding/json"
	. "github.com/eolinker/goku/common/version"
	"github.com/eolinker/goku/goku-node/manager/updater"
	"net/http"
)

func gokuUpdate(w http.ResponseWriter, r *http.Request)  {
	updater.Update()
}
func gokuCheckUpdate(w http.ResponseWriter, r *http.Request) {
	resultInfo := map[string]interface{}{
		"type":       "update",
		"statusCode": "000000",
		"version":    Version,
	}
	resultStr, _ := json.Marshal(resultInfo)

	w.WriteHeader(200)
	_, _ = w.Write(resultStr)
	return
}