-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
55 lines (42 loc) · 850 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"encoding/json"
"log"
"os"
"github.com/SpencerSharkey/gomc/query"
)
// Version - app release version
const Version string = "0.0.1"
func doSimpleQuery(addr string) {
req := query.NewRequest()
err := req.Connect(addr)
if err != nil {
log.Fatalln(err)
}
res, err := req.Simple()
if err != nil {
log.Fatalln(err)
}
log.Println("=== SIMPLE QUERY ===")
o, _ := json.MarshalIndent(res, "", " ")
log.Println(string(o))
}
func doFullQuery(addr string) {
req := query.NewRequest()
err := req.Connect(addr)
if err != nil {
log.Fatalln(err)
}
res, err := req.Full()
if err != nil {
log.Fatalln(err)
}
log.Println("==== FULL QUERY ====")
o, _ := json.MarshalIndent(res, "", " ")
log.Println(string(o))
}
// simple query test
func main() {
doSimpleQuery(os.Args[1])
doFullQuery(os.Args[1])
}