sqlite的api,便于内部使用
liuxiaolong
2019-10-29 80b0c688ce12214b39792fd235f2a10b7db59429
client.go
@@ -1,5 +1,7 @@
package dbapi
import "strconv"
type Client interface {
   //GET
   DoGetRequest(url string, params map[string]string, headers map[string]string) ([]byte, error)
@@ -11,10 +13,19 @@
   DoDeleteRequest(url string, contentType string, body map[string]interface{}, headers map[string]string) ([]byte, error)
}
var BASIC_URL            = "http://127.0.0.1:8001"
var DEFAULT_IP          = "127.0.0.1"
var DEFAULT_PORT         = 8001
const (
   BASIC_URL            = "http://192.168.1.115:8000"
   DATA_URL_PREFIX      = "/data/api-v"
   CONTENT_TYPE_FORM    = "application/x-www-form-urlencoded"
   CONTENT_TYPE_MULFORM = "multipart/form-data"
   CONTENT_TYPE_JSON    = "application/json"
)
//初始化dbserver的地址和端口
func Init(ip string,port int){
   BASIC_URL = "http://"+ ip + ":" + strconv.Itoa(port)
}