-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
433 lines (365 loc) · 10 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>README</title>
<meta charset="UTF-8">
<style>hr,
img {
box-sizing: content-box
}
body::after,
body::before,
hr::after,
hr::before {
display: table;
content: ""
}
a,
a:not([href]) {
text-decoration: none
}
hr,
svg:not(:root) {
overflow: hidden
}
img,
table tr {
background-color: #fff
}
pre,
table {
overflow: auto
}
dl,
dl dt,
hr,
pre code,
pre>code,
td,
th {
padding: 0
}
input,
pre code {
overflow: visible
}
pre,
pre code {
word-wrap: normal
}
body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
width: 820px;
margin: 2em auto;
}
a {
background-color: transparent;
-webkit-text-decoration-skip: objects;
color: #4078c0
}
a:active,
a:hover {
outline-width: 0;
text-decoration: underline
}
h1 {
margin: .67em 0
}
img {
border-style: none;
max-width: 100%
}
h1,
h2 {
padding-bottom: .3em;
border-bottom: 1px solid #eee
}
input {
font: inherit;
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit
}
* {
box-sizing: border-box
}
strong {
font-weight: 600
}
body::after,
hr::after {
clear: both
}
table {
border-spacing: 0;
border-collapse: collapse;
display: block;
width: 100%
}
blockquote {
margin: 0;
padding: 0 1em;
color: #777;
border-left: .25em solid #ddd
}
ol ol,
ul ol {
list-style-type: lower-roman
}
ol ol ol,
ol ul ol,
ul ol ol,
ul ul ol {
list-style-type: lower-alpha
}
dd {
margin-left: 0
}
code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace
}
pre {
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace
}
input {
-webkit-font-feature-settings: "liga" 0;
font-feature-settings: "liga" 0
}
body>:first-child {
margin-top: 0!important
}
body>:last-child {
margin-bottom: 0!important
}
a:not([href]) {
color: inherit
}
blockquote,
dl,
ol,
p,
pre,
table,
ul {
margin-top: 0;
margin-bottom: 16px
}
hr {
background: #e7e7e7;
height: .25em;
margin: 24px 0;
border: 0
}
blockquote>:first-child {
margin-top: 0
}
blockquote>:last-child {
margin-bottom: 0
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25
}
dl dt,
table th {
font-weight: 700
}
h1 code,
h1 tt,
h2 code,
h2 tt,
h3 code,
h3 tt,
h4 code,
h4 tt,
h5 code,
h5 tt,
h6 code,
h6 tt {
font-size: inherit
}
h1 {
font-size: 2em
}
h2 {
font-size: 1.5em
}
h3 {
font-size: 1.25em
}
h4 {
font-size: 1em
}
h5 {
font-size: .875em
}
h6 {
font-size: .85em;
color: #777
}
ol,
ul {
padding-left: 2em
}
ol ol,
ol ul,
ul ol,
ul ul {
margin-top: 0;
margin-bottom: 0
}
li>p {
margin-top: 16px
}
li+li {
margin-top: .25em
}
dl dt {
margin-top: 16px;
font-size: 1em;
font-style: italic
}
dl dd {
padding: 0 16px;
margin-bottom: 16px
}
table td,
table th {
padding: 6px 13px;
border: 1px solid #ddd
}
table tr {
border-top: 1px solid #ccc
}
table tr:nth-child(2n) {
background-color: #f8f8f8
}
code {
padding: .2em 0;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, .04);
border-radius: 3px
}
code::after,
code::before {
letter-spacing: -.2em;
content: "\00a0"
}
pre>code {
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: 0 0;
border: 0
}
pre {
padding: 16px;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px
}
pre code {
display: inline;
max-width: auto;
margin: 0;
line-height: inherit;
background-color: transparent;
border: 0
}
pre code::after,
pre code::before {
content: normal
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: 1px solid #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb
}
hr {
border-bottom-color: #eee
}
</style>
<style class="build-tools-gen-doc">.toc-level-1 .toc-text { padding-left: 1.5em; }
.toc-level-2 .toc-text { padding-left: 2.5em; }
.toc-level-3 .toc-text { padding-left: 3.5em; }
.toc-level-4 .toc-text { padding-left: 4.5em; }
.toc-level-5 .toc-text { padding-left: 5.5em; }
#TOC * { border-width: 0; }
li > p { margin: inherit; }
li > .pod-block-code { margin-top: 16px; }
</style></head>
<body class="pod">
<div id="___top"></div>
<nav class="indexgroup">
<table id="TOC">
<caption><h2 id="TOC_Title">Table of Contents</h2></caption>
<tr class="toc-level-1"><td class="toc-number">1</td><td class="toc-text"><a href="#NAME">NAME</a></td></tr>
<tr class="toc-level-1"><td class="toc-number">2</td><td class="toc-text"><a href="#SYNOPSIS">SYNOPSIS</a></td></tr>
<tr class="toc-level-1"><td class="toc-number">3</td><td class="toc-text"><a href="#DESCRIPTION">DESCRIPTION</a></td></tr>
<tr class="toc-level-2"><td class="toc-number">3.1</td><td class="toc-text"><a href="#Status">Status</a></td></tr>
<tr class="toc-level-2"><td class="toc-number">3.2</td><td class="toc-text"><a href="#Uploading">Uploading</a></td></tr>
<tr class="toc-level-1"><td class="toc-number">4</td><td class="toc-text"><a href="#COPYRIGHT">COPYRIGHT</a></td></tr>
<tr class="toc-level-1"><td class="toc-number">5</td><td class="toc-text"><a href="#LICENSE">LICENSE</a></td></tr>
</table>
</nav>
<div class="pod-body">
<h1 id="NAME"><a class="u" href="#___top" title="go to top of document">NAME</a></h1>
<p><code>WWW::GCloud::API::Storage</code> - <code>WWW::GCloud</code> implementation of <a href="https://cloud.google.com/storage/docs/json_api">Google Storage API</a></p>
<h1 id="SYNOPSIS"><a class="u" href="#___top" title="go to top of document">SYNOPSIS</a></h1>
<pre class="pod-block-code">use v6.e.PREVIEW;
use WWW::GCloud;
use WWW::GCloud::API::Storage;
use WWW::GCloud::R::Storage::Object;
my $gcloud = WWW::GCloud.new;
my $st = $gcloud.storage;
await $st.objects.get("bucket-name", "object-name.ext", :media)
.andthen({ .result.send-to("output-file.ext", :!override) });
</pre>
<h1 id="DESCRIPTION"><a class="u" href="#___top" title="go to top of document">DESCRIPTION</a></h1>
<p>This module lacks complete documentation due to me not currently able to write it. Please, see some notes for <a href="https://raku.land/zef:vrurg/WWW::GCloud"><code>WWW::GCloud</code></a> framework. And look into <em>exmaples/</em> where I tried to provide meaningful code to follow.</p>
<h2 id="Status"><a class="u" href="#___top" title="go to top of document">Status</a></h2>
<p>This module is pre-beta, pre-anything. It is incomplete and likely not well thought out at places. But it already lets you do a lot with your storages.</p>
<p>If there is anything you need but it is missing then, please, consider implementing it and submitting a PR. Any other approach would barely proces any outcome for what I do apologize!</p>
<p>Either way, this module can be used as a reference implementation for a <code>WWW::GGCloud</code> API.</p>
<p>Do not hesitate to get in touch with me would you need any help. I know it could be annoying when a complex module has little to none docs. I'll do my best to fix the situation. But until then feel free to open an issue in the <a href="https://github.com/vrurg/raku-WWW-GCloud-API-Storage/issues">GitHub repository</a>, even if it's just a question.</p>
<h2 id="Uploading"><a class="u" href="#___top" title="go to top of document">Uploading</a></h2>
<p>Contrary to a typical convention about API resource methods returning either a <a href="https://docs.raku.org/type/Promise"><code>Promise</code></a> or a <a href="https://docs.raku.org/type/Supply"><code>Supply</code></a>, when an upload is requested with <code>insert</code> method of <code>objects</code> resource an uploader object is given back to the user. The object would be implementing <code>WWW::GCloud::API::Storage::Upload</code> role.</p>
<p>There are two kinds of uploads are currently implemented: simple and resumable. The former is preferable for smaller files, the latter is better be used for huge ones. Where is the edge between 'small' and 'large' is determined by the bandwidth and quality of one's connection.</p>
<p>Either implementation of the uploader tries to optimize memory usage by reading data in chunks and submitting each chunk to the network immediately. But using <code>:!segemnted</code> flag to create the uploader object turns this behavior off for the simple uploads.</p>
<p>The uploader can feed data directly from a handle without knowing what lays behind the handle. The only requirement is imposed by resumable upload as it has to be able to seek within the stream in case it needs to resend a chunk.</p>
<p>The upload process can be monitored by subscribiting to a <a href="https://docs.raku.org/type/Supply"><code>Supply</code></a> provided by uploader's <code>progress</code> method which emits upload events like "buffer read", "retry requested", "done".</p>
<p>Since the actual REST calls are done by the uploader its <code>upload</code> method is the one which complies to the convention of API resource methods returning <a href="https://docs.raku.org/type/Promise"><code>Promise</code></a>.</p>
<p>See <em>exmaples/bucket-upload.raku</em> for a reference implementation.</p>
<h1 id="COPYRIGHT"><a class="u" href="#___top" title="go to top of document">COPYRIGHT</a></h1>
<p>(c) 2023, Vadim Belman <vrurg@cpan.org></p>
<h1 id="LICENSE"><a class="u" href="#___top" title="go to top of document">LICENSE</a></h1>
<p>Artistic License 2.0</p>
<p>See the <a href="LICENSE"><em>LICENSE</em></a> file in this distribution.</p>
</div>
</body>
</html>