From 0ce10d63b42524d3e4e4b9a2ea35901048a33eb1 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期一, 02 三月 2020 17:22:37 +0800
Subject: [PATCH] add name filter
---
client.go | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/client.go b/client.go
index 20bb145..d3539b0 100644
--- a/client.go
+++ b/client.go
@@ -1,5 +1,10 @@
package dbapi
+import (
+ "fmt"
+ "strconv"
+)
+
type Client interface {
//GET
DoGetRequest(url string, params map[string]string, headers map[string]string) ([]byte, error)
@@ -13,6 +18,9 @@
var BASIC_URL = "http://127.0.0.1:8001"
+var DEFAULT_IP = "127.0.0.1"
+var DEFAULT_PORT = 8001
+
const (
DATA_URL_PREFIX = "/data/api-v"
CONTENT_TYPE_FORM = "application/x-www-form-urlencoded"
@@ -20,7 +28,16 @@
CONTENT_TYPE_JSON = "application/json"
)
+var logPrint = func(i ...interface{}) {
+ fmt.Println(i)
+}
//鍒濆鍖杁bserver鐨勫湴鍧�鍜岀鍙�
func Init(ip string,port int){
- BASIC_URL = "http://"+ ip + ":" + string(port)
+ BASIC_URL = "http://"+ ip + ":" + strconv.Itoa(port)
+}
+
+func InitLog(fn func(i ...interface{})) {
+ if fn != nil {
+ logPrint = fn
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0