sqlite的api,便于内部使用
liuxiaolong
2019-08-22 f15a7ffa5a2fbc8bd37bd9d24a1f32f205dab5bb
add FindCluster
1个文件已修改
18 ■■■■■ 已修改文件
cluster.go 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cluster.go
@@ -6,6 +6,22 @@
}
func (api ClusterApi) FindCluster() (bool,interface{}) {
    url := BASIC_URL + DATA_URL_PREFIX + "/cluster/findCluster"
    client := NewClient()
    body,err := client.DoGetRequest(url, nil,nil)
    if err != nil {
        return false,nil
    }
    var res Result
    if err = json.Unmarshal(body, &res); err != nil {
        return false,nil
    }
    return res.Success,res.Data
}
func (api ClusterApi) Create(clusterName string, password string) (bool,interface{}) {
    url := BASIC_URL + DATA_URL_PREFIX + "/cluster/create"
    client := NewClient()
@@ -47,7 +63,7 @@
}
func (api ClusterApi) GetSearchNodes() (bool,interface{}) {
    url := BASIC_URL + DATA_URL_PREFIX + "/cluster/getNodesByNum"
    url := BASIC_URL + DATA_URL_PREFIX + "/cluster/getSearchNodes"
    client := NewClient()
    body,err := client.DoGetRequest(url, nil,nil)
    if err != nil {