优化apollo迁移工具

This commit is contained in:
白茶清欢 2021-12-02 15:17:18 +08:00
parent bf6d8adc4c
commit 37601a03a1

View File

@ -13,7 +13,6 @@ import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/ddliu/go-httpclient"
)
@ -24,17 +23,6 @@ import (
//
// Date : 4:06 下午 2021/11/30
func NewApolloMigrate(getAllApolloConfigURL string, appID string, env string, namespace string, cookie map[string]string, header map[string]string) ITransform {
if len(getAllApolloConfigURL) == 0 {
getAllApolloConfigURL = "http://test-apollo.portal.life.ke.com/apps/{APP_ID}/envs/{ENV}/clusters/default/namespaces/{NAMESPACE}/releases/active?page=0&size=1"
replaceMap := map[string]string{
"{APP_ID}": appID,
"{ENV}": env,
"{NAMESPACE}": namespace,
}
for k, v := range replaceMap {
getAllApolloConfigURL = strings.ReplaceAll(getAllApolloConfigURL, k, v)
}
}
if cookie == nil {
cookie = make(map[string]string)
header = make(map[string]string)