sqlite的api,便于内部使用
liuxiaolong
2020-10-17 985d4476989e808a2ab5aa0e4fed92a46f7ec0a6
cluster.go
@@ -1,6 +1,7 @@
package dbapi
import (
   "basic.com/pubsub/protomsg.git"
   "encoding/json"
   "strconv"
)
@@ -23,20 +24,21 @@
   return "http://"+api.Ip+":"+strconv.Itoa(api.Port)
}
func (api ClusterApi) FindCluster() (bool,interface{}) {
func (api ClusterApi) FindCluster() (b bool,c protomsg.ClusterAndNodes) {
   url := api.getBasicUrl() + DATA_URL_PREFIX + "/cluster/findCluster"
   client := NewClient()
   body,err := client.DoGetRequest(url, nil,nil)
   if err != nil {
      return false,nil
      return false,c
   }
   var res Result
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
      return false,c
   }
   return res.Success,res.Data
   bytes, _ := json.Marshal(res.Data)
   err = json.Unmarshal(bytes, &c)
   return res.Success,c
}
func (api ClusterApi) Create(clusterName string, password string, virtualIp string) (bool,interface{}) {