@@ -5,11 +5,9 @@ import (
5
5
"path"
6
6
"time"
7
7
8
- "github.com/repoowner/sdk-for-go/bar "
8
+ "github.com/repoowner/sdk-for-go/appwrite "
9
9
"github.com/repoowner/sdk-for-go/client"
10
10
"github.com/repoowner/sdk-for-go/file"
11
- "github.com/repoowner/sdk-for-go/foo"
12
- "github.com/repoowner/sdk-for-go/general"
13
11
"github.com/repoowner/sdk-for-go/id"
14
12
"github.com/repoowner/sdk-for-go/permission"
15
13
"github.com/repoowner/sdk-for-go/query"
@@ -19,11 +17,9 @@ import (
19
17
func main () {
20
18
stringInArray := []interface {}{"string in array" }
21
19
22
- client := client .NewClient ()
23
- err := client .SetTimeout (60 * time .Second )
24
- if err != nil {
25
- panic (err )
26
- }
20
+ client := appwrite .NewClient (
21
+ appwrite .WithTimeout (60 * time .Second ),
22
+ )
27
23
client .AddHeader ("Origin" , "http://localhost" )
28
24
fmt .Print ("\n \n Test Started\n " )
29
25
testFooService (client , stringInArray )
@@ -32,7 +28,7 @@ func main() {
32
28
}
33
29
34
30
func testFooService (client client.Client , stringInArray []interface {}) {
35
- foo := foo .NewFoo (client )
31
+ foo := appwrite .NewFoo (client )
36
32
// Foo Service
37
33
response , err := foo .Get ("string" , 123 , stringInArray )
38
34
if err != nil {
@@ -66,7 +62,7 @@ func testFooService(client client.Client, stringInArray []interface{}) {
66
62
}
67
63
68
64
func testBarService (client client.Client , stringInArray []interface {}) {
69
- bar := bar .NewBar (client )
65
+ bar := appwrite .NewBar (client )
70
66
// Bar Service
71
67
response , err := bar .Get ("string" , 123 , stringInArray )
72
68
if err != nil {
@@ -100,7 +96,7 @@ func testBarService(client client.Client, stringInArray []interface{}) {
100
96
}
101
97
102
98
func testGeneralService (client client.Client , stringInArray []interface {}) {
103
- general := general .NewGeneral (client )
99
+ general := appwrite .NewGeneral (client )
104
100
// General Service
105
101
response , err := general .Redirect ()
106
102
if err != nil {
@@ -152,7 +148,7 @@ func testGeneralService(client client.Client, stringInArray []interface{}) {
152
148
}
153
149
154
150
func testGeneralUpload (client client.Client , stringInArray []interface {}) {
155
- general := general .NewGeneral (client )
151
+ general := appwrite .NewGeneral (client )
156
152
uploadFile := path .Join ("/app" , "tests/resources/file.png" )
157
153
inputFile := file .NewInputFile (uploadFile , "file.png" )
158
154
@@ -164,7 +160,7 @@ func testGeneralUpload(client client.Client, stringInArray []interface{}) {
164
160
}
165
161
166
162
func testGeneralDownload (client client.Client ) {
167
- general := general .NewGeneral (client )
163
+ general := appwrite .NewGeneral (client )
168
164
response , err := general .Download ()
169
165
if err != nil {
170
166
fmt .Printf ("general.Download => error %v" , err )
@@ -173,7 +169,7 @@ func testGeneralDownload(client client.Client) {
173
169
}
174
170
175
171
func testLargeUpload (client client.Client , stringInArray []interface {}) {
176
- general := general .NewGeneral (client )
172
+ general := appwrite .NewGeneral (client )
177
173
uploadFile := path .Join ("/app" , "tests/resources/large_file.mp4" )
178
174
inputFile := file .NewInputFile (uploadFile , "large_file.mp4" )
179
175
0 commit comments