@@ -2,8 +2,6 @@ package guacapi
2
2
3
3
import (
4
4
"encoding/json"
5
- "io/ioutil"
6
- "net/http"
7
5
)
8
6
9
7
type RootGuacConnection struct {
@@ -50,22 +48,7 @@ type GuacConnectionAttributes struct {
50
48
}
51
49
52
50
func (g * Guac ) GetConnections () (RootGuacConnection , error ) {
53
- req , _ := http .NewRequest ("GET" , g .URI + "/api/session/data/mysql/connectionGroups/ROOT/tree" , nil )
54
-
55
- q := req .URL .Query ()
56
- q .Add ("token" , g .Token )
57
- req .URL .RawQuery = q .Encode ()
58
-
59
- client := & http.Client {}
60
- resp , err := client .Do (req )
61
- if err != nil {
62
- return RootGuacConnection {}, err
63
- }
64
-
65
- body , err := ioutil .ReadAll (resp .Body )
66
- if err != nil {
67
- return RootGuacConnection {}, err
68
- }
51
+ body , err := g .Call ("GET" , "/api/session/data/mysql/connectionGroups/ROOT/tree" , map [string ]string {})
69
52
70
53
var connresp RootGuacConnection
71
54
@@ -76,3 +59,18 @@ func (g *Guac) GetConnections() (RootGuacConnection, error) {
76
59
77
60
return connresp , err
78
61
}
62
+
63
+ // TODO
64
+ func (g * Guac ) GetConnectionsFlat () ([]GuacConnection , error ) {
65
+ return []GuacConnection {}, nil
66
+ }
67
+
68
+ func (g * Guac ) AddConnection (conn GuacConnection ) (GuacConnection , error ) {
69
+ return GuacConnection {}, nil
70
+ }
71
+ func (g * Guac ) DeleteConnection (conn GuacConnection ) (GuacConnection , error ) {
72
+ return GuacConnection {}, nil
73
+ }
74
+ func (g * Guac ) GetConnection (conn GuacConnection ) (GuacConnection , error ) {
75
+ return GuacConnection {}, nil
76
+ }
0 commit comments