@@ -13,7 +13,7 @@ func TestCreateAndDeleteWorkspace(t *testing.T) {
13
13
t .Fatalf ("Error creating workspace: %v" , err )
14
14
}
15
15
16
- err = g .DeleteWorkspace (context .Background (), id )
16
+ err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
17
17
if err != nil {
18
18
t .Errorf ("Error deleting workspace: %v" , err )
19
19
}
@@ -26,18 +26,18 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
26
26
}
27
27
28
28
t .Cleanup (func () {
29
- err := g .DeleteWorkspace (context .Background (), id )
29
+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
30
30
if err != nil {
31
31
t .Errorf ("Error deleting workspace: %v" , err )
32
32
}
33
33
})
34
34
35
- err = g .WriteFileInWorkspace (context .Background (), id , "test.txt" , []byte ("test" ))
35
+ err = g .WriteFileInWorkspace (context .Background (), "test.txt" , []byte ("test" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
36
36
if err != nil {
37
37
t .Fatalf ("Error creating file: %v" , err )
38
38
}
39
39
40
- content , err := g .ReadFileInWorkspace (context .Background (), id , "test.txt" )
40
+ content , err := g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions { WorkspaceID : id } )
41
41
if err != nil {
42
42
t .Errorf ("Error reading file: %v" , err )
43
43
}
@@ -46,7 +46,7 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
46
46
t .Errorf ("Unexpected content: %s" , content )
47
47
}
48
48
49
- err = g .DeleteFileInWorkspace (context .Background (), id , "test.txt" )
49
+ err = g .DeleteFileInWorkspace (context .Background (), "test.txt" , DeleteFileInWorkspaceOptions { WorkspaceID : id } )
50
50
if err != nil {
51
51
t .Errorf ("Error deleting file: %v" , err )
52
52
}
@@ -59,34 +59,34 @@ func TestLsComplexWorkspace(t *testing.T) {
59
59
}
60
60
61
61
t .Cleanup (func () {
62
- err := g .DeleteWorkspace (context .Background (), id )
62
+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
63
63
if err != nil {
64
64
t .Errorf ("Error deleting workspace: %v" , err )
65
65
}
66
66
})
67
67
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 } )
69
69
if err != nil {
70
70
t .Fatalf ("Error creating file: %v" , err )
71
71
}
72
72
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 } )
74
74
if err != nil {
75
75
t .Fatalf ("Error creating file: %v" , err )
76
76
}
77
77
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 } )
79
79
if err != nil {
80
80
t .Fatalf ("Error creating file: %v" , err )
81
81
}
82
82
83
- err = g .WriteFileInWorkspace (context .Background (), id , ".hidden.txt" , []byte ("hidden" ))
83
+ err = g .WriteFileInWorkspace (context .Background (), ".hidden.txt" , []byte ("hidden" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
84
84
if err != nil {
85
85
t .Fatalf ("Error creating hidden file: %v" , err )
86
86
}
87
87
88
88
// List all files
89
- content , err := g .ListFilesInWorkspace (context .Background (), id )
89
+ content , err := g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
90
90
if err != nil {
91
91
t .Fatalf ("Error listing files: %v" , err )
92
92
}
@@ -96,7 +96,7 @@ func TestLsComplexWorkspace(t *testing.T) {
96
96
}
97
97
98
98
// 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" })
100
100
if err != nil {
101
101
t .Fatalf ("Error listing files: %v" , err )
102
102
}
@@ -106,13 +106,13 @@ func TestLsComplexWorkspace(t *testing.T) {
106
106
}
107
107
108
108
// 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" } )
110
110
if err != nil {
111
111
t .Fatalf ("Error removing files: %v" , err )
112
112
}
113
113
114
114
// List files in subdirectory
115
- content , err = g .ListFilesInWorkspace (context .Background (), id )
115
+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
116
116
if err != nil {
117
117
t .Fatalf ("Error listing files: %v" , err )
118
118
}
@@ -132,7 +132,7 @@ func TestCreateAndDeleteWorkspaceS3(t *testing.T) {
132
132
t .Fatalf ("Error creating workspace: %v" , err )
133
133
}
134
134
135
- err = g .DeleteWorkspace (context .Background (), id )
135
+ err = g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
136
136
if err != nil {
137
137
t .Errorf ("Error deleting workspace: %v" , err )
138
138
}
@@ -149,18 +149,18 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
149
149
}
150
150
151
151
t .Cleanup (func () {
152
- err := g .DeleteWorkspace (context .Background (), id )
152
+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
153
153
if err != nil {
154
154
t .Errorf ("Error deleting workspace: %v" , err )
155
155
}
156
156
})
157
157
158
- err = g .WriteFileInWorkspace (context .Background (), id , "test.txt" , []byte ("test" ))
158
+ err = g .WriteFileInWorkspace (context .Background (), "test.txt" , []byte ("test" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
159
159
if err != nil {
160
160
t .Fatalf ("Error creating file: %v" , err )
161
161
}
162
162
163
- content , err := g .ReadFileInWorkspace (context .Background (), id , "test.txt" )
163
+ content , err := g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions { WorkspaceID : id } )
164
164
if err != nil {
165
165
t .Errorf ("Error reading file: %v" , err )
166
166
}
@@ -169,7 +169,7 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
169
169
t .Errorf ("Unexpected content: %s" , content )
170
170
}
171
171
172
- err = g .DeleteFileInWorkspace (context .Background (), id , "test.txt" )
172
+ err = g .DeleteFileInWorkspace (context .Background (), "test.txt" , DeleteFileInWorkspaceOptions { WorkspaceID : id } )
173
173
if err != nil {
174
174
t .Errorf ("Error deleting file: %v" , err )
175
175
}
@@ -186,34 +186,34 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
186
186
}
187
187
188
188
t .Cleanup (func () {
189
- err := g .DeleteWorkspace (context .Background (), id )
189
+ err := g .DeleteWorkspace (context .Background (), DeleteWorkspaceOptions { WorkspaceID : id } )
190
190
if err != nil {
191
191
t .Errorf ("Error deleting workspace: %v" , err )
192
192
}
193
193
})
194
194
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 } )
196
196
if err != nil {
197
197
t .Fatalf ("Error creating file: %v" , err )
198
198
}
199
199
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 } )
201
201
if err != nil {
202
202
t .Fatalf ("Error creating file: %v" , err )
203
203
}
204
204
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 } )
206
206
if err != nil {
207
207
t .Fatalf ("Error creating file: %v" , err )
208
208
}
209
209
210
- err = g .WriteFileInWorkspace (context .Background (), id , ".hidden.txt" , []byte ("hidden" ))
210
+ err = g .WriteFileInWorkspace (context .Background (), ".hidden.txt" , []byte ("hidden" ), WriteFileInWorkspaceOptions { WorkspaceID : id } )
211
211
if err != nil {
212
212
t .Fatalf ("Error creating hidden file: %v" , err )
213
213
}
214
214
215
215
// List all files
216
- content , err := g .ListFilesInWorkspace (context .Background (), id )
216
+ content , err := g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
217
217
if err != nil {
218
218
t .Fatalf ("Error listing files: %v" , err )
219
219
}
@@ -223,7 +223,7 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
223
223
}
224
224
225
225
// 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" })
227
227
if err != nil {
228
228
t .Fatalf ("Error listing files: %v" , err )
229
229
}
@@ -233,13 +233,13 @@ func TestLsComplexWorkspaceS3(t *testing.T) {
233
233
}
234
234
235
235
// 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" } )
237
237
if err != nil {
238
238
t .Fatalf ("Error removing files: %v" , err )
239
239
}
240
240
241
241
// List files in subdirectory
242
- content , err = g .ListFilesInWorkspace (context .Background (), id )
242
+ content , err = g .ListFilesInWorkspace (context .Background (), ListFilesInWorkspaceOptions { WorkspaceID : id } )
243
243
if err != nil {
244
244
t .Fatalf ("Error listing files: %v" , err )
245
245
}
0 commit comments