@@ -5,11 +5,9 @@ import (
55 "path"
66 "time"
77
8- "github.com/repoowner/sdk-for-go/bar "
8+ "github.com/repoowner/sdk-for-go/appwrite "
99 "github.com/repoowner/sdk-for-go/client"
1010 "github.com/repoowner/sdk-for-go/file"
11- "github.com/repoowner/sdk-for-go/foo"
12- "github.com/repoowner/sdk-for-go/general"
1311 "github.com/repoowner/sdk-for-go/id"
1412 "github.com/repoowner/sdk-for-go/permission"
1513 "github.com/repoowner/sdk-for-go/query"
@@ -19,11 +17,9 @@ import (
1917func main () {
2018 stringInArray := []interface {}{"string in array" }
2119
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+ )
2723 client .AddHeader ("Origin" , "http://localhost" )
2824 fmt .Print ("\n \n Test Started\n " )
2925 testFooService (client , stringInArray )
@@ -32,7 +28,7 @@ func main() {
3228}
3329
3430func testFooService (client client.Client , stringInArray []interface {}) {
35- foo := foo .NewFoo (client )
31+ foo := appwrite .NewFoo (client )
3632 // Foo Service
3733 response , err := foo .Get ("string" , 123 , stringInArray )
3834 if err != nil {
@@ -66,7 +62,7 @@ func testFooService(client client.Client, stringInArray []interface{}) {
6662}
6763
6864func testBarService (client client.Client , stringInArray []interface {}) {
69- bar := bar .NewBar (client )
65+ bar := appwrite .NewBar (client )
7066 // Bar Service
7167 response , err := bar .Get ("string" , 123 , stringInArray )
7268 if err != nil {
@@ -100,7 +96,7 @@ func testBarService(client client.Client, stringInArray []interface{}) {
10096}
10197
10298func testGeneralService (client client.Client , stringInArray []interface {}) {
103- general := general .NewGeneral (client )
99+ general := appwrite .NewGeneral (client )
104100 // General Service
105101 response , err := general .Redirect ()
106102 if err != nil {
@@ -152,7 +148,7 @@ func testGeneralService(client client.Client, stringInArray []interface{}) {
152148}
153149
154150func testGeneralUpload (client client.Client , stringInArray []interface {}) {
155- general := general .NewGeneral (client )
151+ general := appwrite .NewGeneral (client )
156152 uploadFile := path .Join ("/app" , "tests/resources/file.png" )
157153 inputFile := file .NewInputFile (uploadFile , "file.png" )
158154
@@ -164,7 +160,7 @@ func testGeneralUpload(client client.Client, stringInArray []interface{}) {
164160}
165161
166162func testGeneralDownload (client client.Client ) {
167- general := general .NewGeneral (client )
163+ general := appwrite .NewGeneral (client )
168164 response , err := general .Download ()
169165 if err != nil {
170166 fmt .Printf ("general.Download => error %v" , err )
@@ -173,7 +169,7 @@ func testGeneralDownload(client client.Client) {
173169}
174170
175171func testLargeUpload (client client.Client , stringInArray []interface {}) {
176- general := general .NewGeneral (client )
172+ general := appwrite .NewGeneral (client )
177173 uploadFile := path .Join ("/app" , "tests/resources/large_file.mp4" )
178174 inputFile := file .NewInputFile (uploadFile , "large_file.mp4" )
179175
0 commit comments