@@ -13,7 +13,7 @@ func TestCreateAndDeleteWorkspace(t *testing.T) {
1313 t .Fatalf ("Error creating workspace: %v" , err )
1414 }
1515
16- err = g .DeleteWorkspace (context .Background (), id )
16+ err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
1717 if err != nil {
1818 t .Errorf ("Error deleting workspace: %v" , err )
1919 }
@@ -26,18 +26,18 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
2626 }
2727
2828 t .Cleanup (func () {
29- err := g .DeleteWorkspace (context .Background (), id )
29+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
3030 if err != nil {
3131 t .Errorf ("Error deleting workspace: %v" , err )
3232 }
3333 })
3434
35- err = g .WriteFileInWorkspace (context .Background (), id , "test.txt" , []byte ("test" ))
35+ err = g .WriteFileInWorkspace (context .Background (), "test.txt" , []byte ("test" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
3636 if err != nil {
3737 t .Fatalf ("Error creating file: %v" , err )
3838 }
3939
40- content , err := g .ReadFileInWorkspace (context .Background (), id , "test.txt" )
40+ content , err := g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions { WorkspaceID : id } )
4141 if err != nil {
4242 t .Errorf ("Error reading file: %v" , err )
4343 }
@@ -46,7 +46,7 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
4646 t .Errorf ("Unexpected content: %s" , content )
4747 }
4848
49- err = g .DeleteFileInWorkspace (context .Background (), id , "test.txt" )
49+ err = g .DeleteFileInWorkspace (context .Background (), "test.txt" , DeleteFileInWorkspaceOptions { WorkspaceID : id } )
5050 if err != nil {
5151 t .Errorf ("Error deleting file: %v" , err )
5252 }
@@ -59,34 +59,34 @@ func TestLsComplexWorkspace(t *testing.T) {
5959 }
6060
6161 t .Cleanup (func () {
62- err := g .DeleteWorkspace (context .Background (), id )
62+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
6363 if err != nil {
6464 t .Errorf ("Error deleting workspace: %v" , err )
6565 }
6666 })
6767
68- err = g .WriteFileInWorkspace (context .Background (), id , "test/test1.txt" , []byte ("hello1" ))
68+ err = g .WriteFileInWorkspace (context .Background (), "test/test1.txt" , []byte ("hello1" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
6969 if err != nil {
7070 t .Fatalf ("Error creating file: %v" , err )
7171 }
7272
73- err = g .WriteFileInWorkspace (context .Background (), id , "test1/test2.txt" , []byte ("hello2" ))
73+ err = g .WriteFileInWorkspace (context .Background (), "test1/test2.txt" , []byte ("hello2" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
7474 if err != nil {
7575 t .Fatalf ("Error creating file: %v" , err )
7676 }
7777
78- err = g .WriteFileInWorkspace (context .Background (), id , "test1/test3.txt" , []byte ("hello3" ))
78+ err = g .WriteFileInWorkspace (context .Background (), "test1/test3.txt" , []byte ("hello3" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
7979 if err != nil {
8080 t .Fatalf ("Error creating file: %v" , err )
8181 }
8282
83- err = g .WriteFileInWorkspace (context .Background (), id , ".hidden.txt" , []byte ("hidden" ))
83+ err = g .WriteFileInWorkspace (context .Background (), ".hidden.txt" , []byte ("hidden" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
8484 if err != nil {
8585 t .Fatalf ("Error creating hidden file: %v" , err )
8686 }
8787
8888 // List all files
89- content , err := g .ListFilesInWorkspace (context .Background (), id )
89+ content , err := g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
9090 if err != nil {
9191 t .Fatalf ("Error listing files: %v" , err )
9292 }
@@ -96,7 +96,7 @@ func TestLsComplexWorkspace(t *testing.T) {
9696 }
9797
9898 // List files in subdirectory
99- content , err = g .ListFilesInWorkspace (context .Background (), id , ListFilesInWorkspaceOptions { Prefix : "test1" })
99+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id , Prefix : "test1" })
100100 if err != nil {
101101 t .Fatalf ("Error listing files: %v" , err )
102102 }
@@ -106,13 +106,13 @@ func TestLsComplexWorkspace(t *testing.T) {
106106 }
107107
108108 // Remove all files with test1 prefix
109- err = g .RemoveAllWithPrefix (context .Background (), id , "test1" )
109+ err = g .RemoveAll (context .Background (), RemoveAllOptions { WorkspaceID : id , WithPrefix : "test1" } )
110110 if err != nil {
111111 t .Fatalf ("Error removing files: %v" , err )
112112 }
113113
114114 // List files in subdirectory
115- content , err = g .ListFilesInWorkspace (context .Background (), id )
115+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
116116 if err != nil {
117117 t .Fatalf ("Error listing files: %v" , err )
118118 }
@@ -132,7 +132,7 @@ func TestCreateAndDeleteWorkspaceS3(t *testing.T) {
132132 t .Fatalf ("Error creating workspace: %v" , err )
133133 }
134134
135- err = g .DeleteWorkspace (context .Background (), id )
135+ err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
136136 if err != nil {
137137 t .Errorf ("Error deleting workspace: %v" , err )
138138 }
@@ -149,18 +149,18 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
149149 }
150150
151151 t .Cleanup (func () {
152- err := g .DeleteWorkspace (context .Background (), id )
152+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
153153 if err != nil {
154154 t .Errorf ("Error deleting workspace: %v" , err )
155155 }
156156 })
157157
158- err = g .WriteFileInWorkspace (context .Background (), id , "test.txt" , []byte ("test" ))
158+ err = g .WriteFileInWorkspace (context .Background (), "test.txt" , []byte ("test" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
159159 if err != nil {
160160 t .Fatalf ("Error creating file: %v" , err )
161161 }
162162
163- content , err := g .ReadFileInWorkspace (context .Background (), id , "test.txt" )
163+ content , err := g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions { WorkspaceID : id } )
164164 if err != nil {
165165 t .Errorf ("Error reading file: %v" , err )
166166 }
@@ -169,7 +169,7 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
169169 t .Errorf ("Unexpected content: %s" , content )
170170 }
171171
172- err = g .DeleteFileInWorkspace (context .Background (), id , "test.txt" )
172+ err = g .DeleteFileInWorkspace (context .Background (), "test.txt" , DeleteFileInWorkspaceOptions { WorkspaceID : id } )
173173 if err != nil {
174174 t .Errorf ("Error deleting file: %v" , err )
175175 }
@@ -186,34 +186,34 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
186186 }
187187
188188 t .Cleanup (func () {
189- err := g .DeleteWorkspace (context .Background (), id )
189+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
190190 if err != nil {
191191 t .Errorf ("Error deleting workspace: %v" , err )
192192 }
193193 })
194194
195- err = g .WriteFileInWorkspace (context .Background (), id , "test/test1.txt" , []byte ("hello1" ))
195+ err = g .WriteFileInWorkspace (context .Background (), "test/test1.txt" , []byte ("hello1" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
196196 if err != nil {
197197 t .Fatalf ("Error creating file: %v" , err )
198198 }
199199
200- err = g .WriteFileInWorkspace (context .Background (), id , "test1/test2.txt" , []byte ("hello2" ))
200+ err = g .WriteFileInWorkspace (context .Background (), "test1/test2.txt" , []byte ("hello2" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
201201 if err != nil {
202202 t .Fatalf ("Error creating file: %v" , err )
203203 }
204204
205- err = g .WriteFileInWorkspace (context .Background (), id , "test1/test3.txt" , []byte ("hello3" ))
205+ err = g .WriteFileInWorkspace (context .Background (), "test1/test3.txt" , []byte ("hello3" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
206206 if err != nil {
207207 t .Fatalf ("Error creating file: %v" , err )
208208 }
209209
210- err = g .WriteFileInWorkspace (context .Background (), id , ".hidden.txt" , []byte ("hidden" ))
210+ err = g .WriteFileInWorkspace (context .Background (), ".hidden.txt" , []byte ("hidden" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
211211 if err != nil {
212212 t .Fatalf ("Error creating hidden file: %v" , err )
213213 }
214214
215215 // List all files
216- content , err := g .ListFilesInWorkspace (context .Background (), id )
216+ content , err := g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
217217 if err != nil {
218218 t .Fatalf ("Error listing files: %v" , err )
219219 }
@@ -223,7 +223,7 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
223223 }
224224
225225 // List files in subdirectory
226- content , err = g .ListFilesInWorkspace (context .Background (), id , ListFilesInWorkspaceOptions { Prefix : "test1" })
226+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id , Prefix : "test1" })
227227 if err != nil {
228228 t .Fatalf ("Error listing files: %v" , err )
229229 }
@@ -233,13 +233,13 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
233233 }
234234
235235 // Remove all files with test1 prefix
236- err = g .RemoveAllWithPrefix (context .Background (), id , "test1" )
236+ err = g .RemoveAll (context .Background (), RemoveAllOptions { WorkspaceID : id , WithPrefix : "test1" } )
237237 if err != nil {
238238 t .Fatalf ("Error removing files: %v" , err )
239239 }
240240
241241 // List files in subdirectory
242- content , err = g .ListFilesInWorkspace (context .Background (), id )
242+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
243243 if err != nil {
244244 t .Fatalf ("Error listing files: %v" , err )
245245 }
0 commit comments