Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit 2c624c8

Browse files
committed
新增start-time 和 end_time参数
1 parent 93a13c5 commit 2c624c8

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode/
22
quake_go
33
quake
4-
config.yaml
4+
config.yaml
5+
test*

main.go

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: ph4nt0mer
33
* @Date: 2022-08-31 17:03:03
44
* @LastEditors: rootphantomer
5-
* @LastEditTime: 2022-09-06 18:06:12
5+
* @LastEditTime: 2022-09-07 09:46:49
66
* @FilePath: /quake_go/main.go
77
* @Description:
88
*
@@ -39,14 +39,14 @@ Usage of ./quake:
3939
field string value(example:./quake query port:8088 -t=body,)
4040
-ic bool
4141
ignore_cache value (true or false)
42-
-st time
42+
-s time
4343
start time value, USE UTC
44-
-se time
44+
-e time
4545
end time value, USE UTC
46-
-size string
47-
size String value (default :./quake query port:8088 -size=10)
4846
-start string
49-
start String value (default :./quake query port:8088 -start=0)`)
47+
start String value (default :./quake query port:8088 -start=0)
48+
-size string
49+
size String value (default :./quake query port:8088 -size=10)`)
5050
return
5151
}
5252
path := "./config.yaml"
@@ -79,6 +79,12 @@ Usage of ./quake:
7979
if strings.Contains(tmp[0], "-t") {
8080
reqjson.Field = tmp[1]
8181
}
82+
if strings.Contains(tmp[0], "-s") {
83+
reqjson.Start_time = tmp[1]
84+
}
85+
if strings.Contains(tmp[0], "-e") {
86+
reqjson.End_time = tmp[1]
87+
}
8288
}
8389
switch strings.ToLower(os.Args[1]) {
8490
case "info":

src/apis/api.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: ph4nt0mer
33
* @Date: 2022-09-01 15:36:10
44
* @LastEditors: rootphantomer
5-
* @LastEditTime: 2022-09-06 18:05:32
5+
* @LastEditTime: 2022-09-07 10:00:52
66
* @FilePath: /quake_go/src/apis/api.go
77
* @Description:
88
*
@@ -43,6 +43,11 @@ func SearchServicePost(req Reqjson, token string) {
4343
payload := "{\"query\":\"" + req.Query +
4444
"\",\"start\":\"" + req.Start + "\",\"size\":\"" + req.Size +
4545
"\"}"
46+
// data, err := json.Marshal(req)
47+
// if err!=nil{
48+
// panic(err)
49+
// }
50+
// payload := string(data)
4651
body := tools.ApisPost(setting.URL+uri, payload, token)
4752
resut := utils.SeriveLoadJson(body)
4853
data := resut.Data

0 commit comments

Comments
 (0)