mobiletto 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/lib/cjs/index.d.ts +2 -0
  2. package/lib/cjs/index.js +30 -0
  3. package/lib/cjs/package.json +16 -0
  4. package/lib/esm/index.d.ts +2 -0
  5. package/lib/esm/index.js +12 -0
  6. package/package.json +27 -13
  7. package/.babelrc +0 -5
  8. package/.eslintrc.js +0 -14
  9. package/docs/README.md +0 -113
  10. package/docs/af/README.md +0 -481
  11. package/docs/am/README.md +0 -481
  12. package/docs/ar/README.md +0 -481
  13. package/docs/az/README.md +0 -481
  14. package/docs/be/README.md +0 -481
  15. package/docs/bg/README.md +0 -481
  16. package/docs/bn/README.md +0 -481
  17. package/docs/bs/README.md +0 -481
  18. package/docs/ca/README.md +0 -481
  19. package/docs/ceb/README.md +0 -481
  20. package/docs/co/README.md +0 -481
  21. package/docs/cs/README.md +0 -481
  22. package/docs/cy/README.md +0 -481
  23. package/docs/da/README.md +0 -481
  24. package/docs/de/README.md +0 -481
  25. package/docs/el/README.md +0 -481
  26. package/docs/eo/README.md +0 -481
  27. package/docs/es/README.md +0 -481
  28. package/docs/et/README.md +0 -481
  29. package/docs/eu/README.md +0 -481
  30. package/docs/fa/README.md +0 -481
  31. package/docs/fi/README.md +0 -481
  32. package/docs/fr/README.md +0 -481
  33. package/docs/fy/README.md +0 -481
  34. package/docs/ga/README.md +0 -481
  35. package/docs/gd/README.md +0 -481
  36. package/docs/gl/README.md +0 -481
  37. package/docs/gu/README.md +0 -481
  38. package/docs/ha/README.md +0 -481
  39. package/docs/haw/README.md +0 -481
  40. package/docs/he/README.md +0 -481
  41. package/docs/hi/README.md +0 -481
  42. package/docs/hmn/README.md +0 -481
  43. package/docs/hr/README.md +0 -481
  44. package/docs/ht/README.md +0 -481
  45. package/docs/hu/README.md +0 -481
  46. package/docs/hy/README.md +0 -481
  47. package/docs/id/README.md +0 -481
  48. package/docs/ig/README.md +0 -481
  49. package/docs/is/README.md +0 -481
  50. package/docs/it/README.md +0 -481
  51. package/docs/iw/README.md +0 -481
  52. package/docs/ja/README.md +0 -481
  53. package/docs/jv/README.md +0 -481
  54. package/docs/ka/README.md +0 -481
  55. package/docs/kk/README.md +0 -481
  56. package/docs/km/README.md +0 -481
  57. package/docs/kn/README.md +0 -481
  58. package/docs/ko/README.md +0 -481
  59. package/docs/ku/README.md +0 -481
  60. package/docs/ky/README.md +0 -481
  61. package/docs/la/README.md +0 -481
  62. package/docs/lb/README.md +0 -481
  63. package/docs/lo/README.md +0 -481
  64. package/docs/lt/README.md +0 -481
  65. package/docs/lv/README.md +0 -481
  66. package/docs/mg/README.md +0 -481
  67. package/docs/mi/README.md +0 -481
  68. package/docs/mk/README.md +0 -481
  69. package/docs/ml/README.md +0 -481
  70. package/docs/mn/README.md +0 -481
  71. package/docs/mr/README.md +0 -481
  72. package/docs/ms/README.md +0 -481
  73. package/docs/mt/README.md +0 -481
  74. package/docs/my/README.md +0 -481
  75. package/docs/ne/README.md +0 -481
  76. package/docs/nl/README.md +0 -481
  77. package/docs/no/README.md +0 -481
  78. package/docs/ny/README.md +0 -481
  79. package/docs/or/README.md +0 -481
  80. package/docs/pa/README.md +0 -481
  81. package/docs/pl/README.md +0 -481
  82. package/docs/ps/README.md +0 -481
  83. package/docs/pt/README.md +0 -481
  84. package/docs/ro/README.md +0 -481
  85. package/docs/ru/README.md +0 -481
  86. package/docs/rw/README.md +0 -481
  87. package/docs/sd/README.md +0 -481
  88. package/docs/si/README.md +0 -481
  89. package/docs/sk/README.md +0 -481
  90. package/docs/sl/README.md +0 -481
  91. package/docs/sm/README.md +0 -481
  92. package/docs/sn/README.md +0 -481
  93. package/docs/so/README.md +0 -481
  94. package/docs/sq/README.md +0 -481
  95. package/docs/sr/README.md +0 -481
  96. package/docs/st/README.md +0 -481
  97. package/docs/su/README.md +0 -481
  98. package/docs/sv/README.md +0 -481
  99. package/docs/sw/README.md +0 -481
  100. package/docs/ta/README.md +0 -481
  101. package/docs/te/README.md +0 -481
  102. package/docs/tg/README.md +0 -481
  103. package/docs/th/README.md +0 -481
  104. package/docs/tk/README.md +0 -481
  105. package/docs/tl/README.md +0 -481
  106. package/docs/tr/README.md +0 -481
  107. package/docs/tt/README.md +0 -481
  108. package/docs/ug/README.md +0 -481
  109. package/docs/uk/README.md +0 -481
  110. package/docs/ur/README.md +0 -481
  111. package/docs/uz/README.md +0 -481
  112. package/docs/vi/README.md +0 -481
  113. package/docs/xh/README.md +0 -481
  114. package/docs/yi/README.md +0 -481
  115. package/docs/yo/README.md +0 -481
  116. package/docs/zh/README.md +0 -481
  117. package/docs/zu/README.md +0 -481
  118. package/drivers/b2/index.js +0 -451
  119. package/drivers/local/index.js +0 -315
  120. package/drivers/s3/index.js +0 -316
  121. package/hokey.json +0 -16
  122. package/index.js +0 -10
  123. package/test/api.spec.js +0 -512
  124. package/test/crypt.spec.js +0 -67
  125. package/util/crypt.js +0 -80
  126. package/util/logger.js +0 -27
  127. package/util/redis.js +0 -233
package/docs/or/README.md DELETED
@@ -1,481 +0,0 @@
1
- ମୋବାଇଲଟୋ |
2
- =========
3
-
4
- ମୋବାଇଲଟୋ ହେଉଛି ଏକ ଜାଭାସ୍କ୍ରିପ୍ଟ ଷ୍ଟୋରେଜ୍ ଅବଷ୍ଟ୍ରାକସନ ସ୍ତର, ଇଚ୍ଛାଧୀନ ସ୍ୱଚ୍ଛ କ୍ଲାଏଣ୍ଟ-ସାଇଡ୍ ଏନକ୍ରିପସନ୍ ସହିତ |
5
-
6
- # ବିଷୟବସ୍ତୁ
7
- * [ମୋବାଇଲ୍ କାହିଁକି?](# କାହିଁକି-ମୋବାଇଲଟୋ?)
8
- * [ଶୀଘ୍ର ଆରମ୍ଭ](# ଶୀଘ୍ର ଆରମ୍ଭ)
9
- * [Mobiletto CLI](# mobiletto-cli)
10
- * [ଉତ୍ସ](# ଉତ୍ସ)
11
- * [ସ୍ଥାପନ](# ସ୍ଥାପନ)
12
- * [ସମର୍ଥନ ଏବଂ ପାଣ୍ଠି](# ସମର୍ଥନ-ଏବଂ-ପାଣ୍ଠି)
13
- * [ମ Basic ଳିକ ବ୍ୟବହାର](# ମ Basic ଳିକ-ବ୍ୟବହାର)
14
- * [ମେଟାଡାଟା](# ମେଟାଡାଟା)
15
- * [ବିକଳ୍ପ ଆମଦାନୀ ଶ style ଳୀ](# ବିକଳ୍ପ-ଆମଦାନୀ-ଶ style ଳୀ)
16
- * [କ୍ୟାଚିଂ](# କ୍ୟାଚିଂ)
17
- * [ଦର୍ପଣ](# ଦର୍ପଣ)
18
- * [ସ୍ୱଚ୍ଛ ଏନକ୍ରିପସନ୍](# ସ୍ୱଚ୍ଛ-ଏନକ୍ରିପସନ୍)
19
- * [କି ଘୂର୍ଣ୍ଣନ](# କି-ଘୂର୍ଣ୍ଣନ)
20
- * [ଡ୍ରାଇଭର ଇଣ୍ଟରଫେସ୍](# ଡ୍ରାଇଭର-ଇଣ୍ଟରଫେସ୍)
21
- * [ଲଗିଂ](# ଲଗିଂ)
22
-
23
- # ଏହାକୁ ଅନ୍ୟ ଭାଷାରେ ପ Read ନ୍ତୁ |
24
- ଏହି README.md ଡକ୍ୟୁମେଣ୍ଟକୁ [hokeylization](https://github.com/cobbzilla/hokeylization) ମାଧ୍ୟମରେ ଅନୁବାଦ କରାଯାଇଛି |
25
- ** [ଗୁଗୁଲ୍ ଅନୁବାଦ ଦ୍ୱାରା ସମର୍ଥିତ ପ୍ରତ୍ୟେକ ଭାଷା](https://cloud.google.com/translate/docs/languages)! **
26
-
27
- ମୁଁ ନିଶ୍ଚିତ ଯେ ଏହା ସିଦ୍ଧ ନୁହେଁ, କିନ୍ତୁ ମୁଁ ଆଶା କରେ ଏହା କିଛି ନୁହେଁ!
28
-
29
- [🇸🇦 ଆରବୀ](ଡକସ୍ / ଆର / README.md)
30
- [🇧🇩 ବଙ୍ଗାଳୀ](ଡକସ୍ / bn / README.md)
31
- [🇩🇪 ଜର୍ମାନ](ଡକସ୍ / ଡି / README.md)
32
- [🇺🇸 ଇଂରାଜୀ](ଡକସ୍ / en / README.md)
33
- [🇪🇸 ସ୍ପାନିସ୍](ଡକସ୍ / ଏସ୍ / README.md)
34
- [🇫🇷 ଫରାସୀ](ଡକସ୍ / fr / README.md)
35
- [🇹🇩 ହାଉସା](ଡକସ୍ / ହା / README.md)
36
- [🇮🇳 ହିନ୍ଦୀ](ଡକସ୍ / ହାଏ / README.md)
37
- [🇮🇩 ଇଣ୍ଡୋନେସିଆ](ଡକସ୍ / id / README.md)
38
- [🇮🇹 ଇଟାଲୀୟ](ଡକସ୍ / ଏହା / README.md)
39
- [🇯🇵 ଜାପାନିଜ୍](ଡକସ୍ / ja / README.md)
40
- [🇰🇷 କୋରିଆନ୍](ଡକସ୍ / କୋ / README.md)
41
- [🇮🇳 ମାରନ୍ତୀ](ଡକସ୍ / mr / README.md)
42
- [🇵🇱 ପୋଲାଣ୍ଡ](ଡକସ୍ / pl / README.md)
43
- [🇧🇷 ପର୍ତ୍ତୁଗୀଜ୍](ଡକସ୍ / pt / README.md)
44
- [🇷🇺 Russian ଷିୟ](ଡକସ୍ / ru / README.md)
45
- [Wa ସ୍ Swahili ାହିଲୀ](ଡକସ୍ / sw / README.md)
46
- [Ag ଟ୍ୟାଗଲଗ୍](ଡକସ୍ / tl / README.md)
47
- [🇹🇷 ତୁର୍କୀ](ଡକସ୍ / ଟ୍ର / README.md)
48
- [🇵🇰 ଉର୍ଦ୍ଦୁ](ଡକସ୍ / ur / README.md)
49
- [🇻🇳 ଭିଏତନାମ](ଡକସ୍ / vi / README.md)
50
- [🇨🇳 ଚାଇନିଜ୍](ଡକସ୍ / zh / README.md)
51
-
52
-
53
- ** [📚 ... ସମସ୍ତ ଭାଷା ...](ଡକସ୍ / README.md) **
54
- ----
55
-
56
- ### README ର ଏହି ଅନୁବାଦରେ କିଛି ଅସୁବିଧା ଅଛି କି?
57
- ମୂଳ [README] ର ଏହି ନିର୍ଦ୍ଦିଷ୍ଟ ଅନୁବାଦ (https://github.com/cobbzilla/mobiletto/blob/master/README.md)
58
- ତ୍ରୁଟିଯୁକ୍ତ ହୋଇପାରେ - * ସଂଶୋଧନଗୁଡିକ ଅତ୍ୟନ୍ତ ସ୍ୱାଗତଯୋଗ୍ୟ! * ଦୟାକରି [GitHub ରେ ଟାଣ ଅନୁରୋଧ] ପଠାନ୍ତୁ (https://github.com/cobbzilla/mobiletto/pulls),
59
- କିମ୍ବା ଯଦି ଆପଣ ତାହା କରିବାକୁ ଆରାମଦାୟକ ନୁହଁନ୍ତି, [ଏକ ସମସ୍ୟା ଖୋଲନ୍ତୁ](https://github.com/cobbzilla/mobiletto/issues)
60
-
61
- ଯେତେବେଳେ ଆପଣ ଏକ ଅନୁବାଦ ବିଷୟରେ ଏକ ନୂତନ GitHub ଇସୁ ସୃଷ୍ଟି କରନ୍ତି, ଦୟାକରି କରନ୍ତୁ:
62
- * ପୃଷ୍ଠା URL ଅନ୍ତର୍ଭୂକ୍ତ କରନ୍ତୁ (ବ୍ରାଉଜର୍ ଠିକଣା ଦଣ୍ଡିକାରୁ କପି / ଲେପନ କରନ୍ତୁ)
63
- * ଭୁଲ ସଠିକ୍ ପାଠ୍ୟ ଅନ୍ତର୍ଭୂକ୍ତ କରନ୍ତୁ (ବ୍ରାଉଜରରୁ କପି / ଲେପନ କରନ୍ତୁ)
64
- * ଦୟାକରି କ’ଣ ଭୁଲ୍ ବର୍ଣ୍ଣନା କର - ଅନୁବାଦ ଭୁଲ୍ କି? ଫର୍ମାଟିଂ କ h ଣସି ପ୍ରକାରେ ଭାଙ୍ଗିଗଲା କି?
65
- * ଦୟାକରି ଏକ ଉତ୍ତମ ଅନୁବାଦର ଏକ ପ୍ରସ୍ତାବ ପ୍ରଦାନ କରନ୍ତୁ, କିମ୍ବା ପାଠ କିପରି ସଠିକ୍ ଭାବରେ ଫର୍ମାଟ୍ ହେବା ଉଚିତ |
66
- * **ଧନ୍ୟବାଦ!**
67
-
68
- ## ମୋବାଇଲ୍ କାହିଁକି?
69
-
70
- ### ବିଦାୟ ବିକ୍ରେତା ଲକ୍-ଇନ୍!
71
- ବିଭିନ୍ନ କ୍ଲାଉଡ୍ ଷ୍ଟୋରେଜ୍ ପ୍ରଦାନକାରୀଙ୍କର ଅସଙ୍ଗତ API ଗୁଡିକ ଅଛି | ଏପରିକି ଯେଉଁମାନେ "S3 ସୁସଙ୍ଗତତା" ପାଇଁ ଚେଷ୍ଟା କରନ୍ତି |
72
- ଇଡିଓସିନ୍କ୍ରାଟିକ୍ ଆଚରଣ ଅଛି |
73
-
74
- ଯେତେବେଳେ ତୁମେ ତୁମର ଆପ୍ ପାଇଁ ଏକ ନିର୍ଦ୍ଦିଷ୍ଟ ଷ୍ଟୋରେଜ୍ ବିକ୍ରେତା ବାଛିବ, ଯଦି ତୁମେ ସିଧାସଳଖ ସେମାନଙ୍କ API, ତୁମର ଆପ୍ କୁ କୋଡ୍ କର |
75
- ବର୍ତ୍ତମାନ ସେହି ସେବା ଉପରେ ନିର୍ଭରଶୀଳ | ସମୟ ଗଡିବା ସହ କୋଡ୍ ଜମା ହେବା ସହିତ ବିକ୍ରେତା ପରିବର୍ତ୍ତନ ହୁଏ |
76
- ଦିନକୁ ଦିନ ଅସମ୍ଭବ | ବିକ୍ରେତା ଲକ୍-ଇନ୍ ର ମଜାଳିଆ ଦୁନିଆକୁ ସ୍ Welcome ାଗତ!
77
-
78
- ଏହି ସମସ୍ୟାର ସମାଧାନ ପାଇଁ ମୋବାଇଲଟୋ ଡିଜାଇନ୍ କରାଯାଇଥିଲା | ମୋବାଇଲ୍ ଆପ୍ ର API କୁ ଆପଣଙ୍କର ଆପ୍ କୋଡ୍ କରି, ଆପଣ ସହଜରେ କରିପାରିବେ |
79
- ଷ୍ଟୋରେଜ୍ ପ୍ରଦାନକାରୀ ପରିବର୍ତ୍ତନ କରନ୍ତୁ ଏବଂ ଜାଣନ୍ତୁ ଯେ ଆପଣଙ୍କର ଆପର ଷ୍ଟୋରେଜ୍ ସ୍ତର ସମାନ ଭାବରେ ଆଚରଣ କରିବ |
80
-
81
- ### ବିସ୍ତୃତ ପରୀକ୍ଷା |
82
- ପ୍ରତ୍ୟେକ ଡ୍ରାଇଭର ପାଇଁ 60+ ପରୀକ୍ଷା ସହିତ ସମାନ ଆଚରଣ ପାଇଁ ସମସ୍ତ ଡ୍ରାଇଭର ପରୀକ୍ଷା କରାଯାଏ |
83
- ଆମେ ପ୍ରତ୍ୟେକ ଡ୍ରାଇଭରକୁ ପ୍ରତ୍ୟେକ ମିଶ୍ରଣ ସହିତ ପରୀକ୍ଷା କରୁ:
84
- * ଏନକ୍ରିପସନ୍: ଉଭୟ ସକ୍ଷମ ଏବଂ ଅକ୍ଷମ |
85
- * ରେଡିସ୍ କ୍ୟାଚ୍: ଉଭୟ ସକ୍ଷମ ଏବଂ ଅକ୍ଷମ |
86
-
87
- ଏହି ପନ୍ଥା ଆମକୁ ଶାନ୍ତି-ମାନସିକତା ଦେଇଥାଏ ଯେ ଆପଣ କେଉଁ ଡ୍ରାଇଭର ବ୍ୟବହାର କରନ୍ତି ନା କାହିଁକି ମୋବାଇଲଟୋ ସମାନ ଆଚରଣ କରିବ,
88
- ଏବଂ ଆପଣ କ୍ୟାଚିଂ ଏବଂ / କିମ୍ବା ଏନକ୍ରିପସନ୍ ସକ୍ଷମ କରନ୍ତି କି ନାହିଁ ନିର୍ବିଶେଷରେ |
89
-
90
- ### ଡ୍ରାଇଭର ସମର୍ଥନ
91
- ସାମ୍ପ୍ରତିକ ମୋବାଇଲ୍ ଷ୍ଟୋରେଜ୍ ଡ୍ରାଇଭରଗୁଡ଼ିକ:
92
- * `s3` : ଆମାଜନ S3 |
93
- * `b2` : ବ୍ୟାକବ୍ଲେଜ୍ B2 |
94
- * `local` ସ୍ଥାନୀୟ": ସ୍ଥାନୀୟ ଫାଇଲ୍ ସିଷ୍ଟମ୍ |
95
-
96
- * ଅଧିକ କ୍ଲାଉଡ୍ ଷ୍ଟୋରେଜ୍ ପ୍ରଦାନକାରୀଙ୍କୁ ସମର୍ଥନ କରିବାକୁ ଅବଦାନଗୁଡିକ ସ୍ୱାଗତଯୋଗ୍ୟ! *
97
-
98
- ## mobiletto-cli
99
- ମୋବାଇଲଟୋ ଅନ୍ୟ ଜାଭାସ୍କ୍ରିପ୍ଟ କୋଡ୍ ଦ୍ୱାରା ଲାଇବ୍ରେରୀ ଭାବରେ ବ୍ୟବହୃତ ହେବା ପାଇଁ ଉଦ୍ଦିଷ୍ଟ |
100
-
101
- ମୋବାଇଲ୍ ଲାଇନ୍ ସହିତ କମାଣ୍ଡ୍ ଲାଇନ୍ ରେ କାମ କରିବାକୁ, [mobiletto-cli](https://www.npmjs.com/package/mobiletto-cli) ବ୍ୟବହାର କରନ୍ତୁ |
102
-
103
- ## ଉତ୍ସ |
104
- * [GitHub ରେ mobiletto](https://github.com/cobbzilla/mobiletto)
105
- * [npm ରେ mobiletto](https://www.npmjs.com/package/mobiletto)
106
-
107
- ## ସମର୍ଥନ ଏବଂ ପାଣ୍ଠି
108
- ମୁଁ ଏକ ବୃତ୍ତିଗତ ମୁକ୍ତ ଉତ୍ସ ସଫ୍ଟୱେର୍ ବିକାଶକାରୀ ହେବାକୁ ଚେଷ୍ଟା କରୁଛି | ମୁଁ କାମ କରୁଛି
109
- ଅନେକ ବର୍ଷ ଧରି ସଫ୍ଟୱେର୍ ଇଣ୍ଡଷ୍ଟ୍ରି, ମୁଁ ସଫଳ କମ୍ପାନୀଗୁଡିକ ଆରମ୍ଭ କରି ସାର୍ବଜନୀନ କମ୍ପାନୀଗୁଡିକରେ ବିକ୍ରି କରିଛି |
110
- ସମ୍ପ୍ରତି ମୁଁ ମୋର ଚାକିରୀ ହରାଇଲି, ଏବଂ ମୋର ପ୍ରକୃତରେ ଅନ୍ୟ କ work ଣସି କାମ ଧାଡ଼ିରେ ନାହିଁ |
111
-
112
- ତେଣୁ ମୁଁ ସାହାଯ୍ୟକାରୀ ସଫ୍ଟୱେର୍ ଲେଖିବାକୁ ଚେଷ୍ଟା କରିବାକୁ ଯାଉଛି ଏବଂ ତାହା କାମ କରୁଛି କି ନାହିଁ |
113
-
114
- ଯଦି ଆପଣ ଏହି ସଫ୍ଟୱେର୍ ବ୍ୟବହାର କରିବାକୁ ଉପଭୋଗ କରନ୍ତି, ତେବେ ମୁଁ ମଧ୍ୟ ବହୁତ ଧନ୍ୟବାଦ ଦେବି |
115
- ଛୋଟ [Patreon ମାଧ୍ୟମରେ ମାସିକ ଅବଦାନ](https://www.patreon.com/cobbzilla)
116
-
117
- *ଧନ୍ୟବାଦ!*
118
-
119
- ## ସ୍ଥାପନ
120
- `npm` କିମ୍ବା `yarn` ବ୍ୟବହାର କରି ସଂସ୍ଥାପନ କରନ୍ତୁ | ଆପଣ ବୋଧହୁଏ `lite` ସଂସ୍କରଣ ଚାହୁଁଛନ୍ତି ଯାହା ସମସ୍ତ ଅନ୍ତର୍ଭୂକ୍ତ କରେ ନାହିଁ |
121
- ଅନୁବାଦିତ README ଫାଇଲଗୁଡିକ:
122
-
123
- npm install mobiletto-lite
124
- yarn add mobiletto-lite
125
-
126
- ଯଦି ଆପଣ ପ୍ରକୃତରେ ପ୍ରତ୍ୟେକ ଭାଷାରେ README ଫାଇଲଗୁଡିକ ଚାହୁଁଛନ୍ତି, ତେବେ ପୂର୍ଣ୍ଣ ସଂସ୍କରଣ ସଂସ୍ଥାପନ କରନ୍ତୁ:
127
-
128
- npm install mobiletto
129
- yarn add mobiletto
130
-
131
- ## ଶୀଘ୍ର ଆରମ୍ଭ |
132
- Mobiletto `s3` ଡ୍ରାଇଭର ବ୍ୟବହାର କରି ଏକ ସଂକ୍ଷିପ୍ତ ଉଦାହରଣ |
133
-
134
- ଯଦି ଡ୍ରାଇଭର `b2` କିମ୍ବା `local` ” ଥାଏ ତେବେ ଏହି କୋଡ୍ ସମାନ ଭାବରେ ଚାଲିବ |
135
-
136
- const storage = require('mobiletto')
137
- const bucket = await storage.connect('s3', aws_key, aws_secret, {bucket: 'bk'})
138
-
139
- // list objects: returns array of metadata objects
140
- const listing = await bucket.list()
141
- const dirList = await bucket.list('some/dir/')
142
- const everything = await bucket.list('', {recursive: true})
143
-
144
- // write an entire file
145
- let bytesWritten = await bucket.writeFile('some/path', someBufferOfData)
146
-
147
- // write a file from a stream/generator
148
- bytesWritten = await bucket.write('some/path', streamOrGenerator)
149
-
150
- // read an entire file
151
- // returns null if an exception would otherwise be thrown
152
- const bufferOrNull = await bucket.safeReadFile('some/path')
153
-
154
- // stream-read a file, passing data to callback
155
- const bytesRead = await bucket.read('some/path', (chunk) => { ...do something with chunk... } )
156
-
157
- // remove a file, returns the path removed
158
- let removed = await bucket.remove('some/path') // removed is a string
159
-
160
- // remove a directory, returns array of paths removed
161
- removed = await bucket.remove('some/directory', {recursive: true}) // removed is now an array!
162
-
163
- ----
164
- ## ମ Basic ଳିକ ବ୍ୟବହାର |
165
- ପ୍ରଦାନ କରାଯାଇଥିବା ଅଧିକାଂଶ ବ features ଶିଷ୍ଟ୍ୟଗୁଡିକ ଦର୍ଶାଇ ଏକ ଅଧିକ ବିସ୍ତୃତ ଉଦାହରଣ:
166
-
167
- const { mobiletto } = require('mobiletto')
168
-
169
- // General usage
170
- const api = await mobiletto(driverName, key, secret, opts)
171
-
172
- // To use 'local' driver:
173
- // * key: base directory
174
- // * secret: ignored, can be null
175
- // * opts object:
176
- // * readOnly: optional, never change anything on the filesystem; default is false
177
- // * fileMode: optional, permissions used when creating new files, default is 0600. can be string or integer
178
- // * dirMode: optional, permissions used when creating new directories, default is 0700. can be string or integer
179
- const local = await mobiletto('local', '/home/ubuntu/tmp', null, {fileMode: 0o0600, dirMode: '0700'})
180
-
181
- // To use 's3' driver:
182
- // * key: AWS Access Key ID
183
- // * secret: AWS Secret Key
184
- // * opts object:
185
- // * readOnly: optional, never change anything on the bucket; default is false
186
- // * bucket: required, name of the S3 bucket
187
- // * region: optional, the AWS region to communicate with, default is us-east-1
188
- // * prefix: optional, all read/writes within the S3 bucket will be under this prefix
189
- // * delimiter: optional, directory delimiter, default is '/' (note: always '/' when encryption is enabled)
190
- const s3 = await mobiletto('s3', aws_key, aws_secret, {bucket: 'bk', region: 'us-east-1'})
191
-
192
- // To use 'b2' driver:
193
- // * key: Backblaze Key ID
194
- // * secret: Backblaze Application Key
195
- // * opts object:
196
- // * readOnly: optional, never change anything on the bucket; default is false
197
- // * bucket: required, the ID (**not the name**) of the B2 bucket
198
- // * prefix: optional, all read/writes within the B2 bucket will be under this prefix
199
- // * delimiter: optional, directory delimiter, default is '/' (note: always '/' when encryption is enabled)
200
- // * partSize: optional, large files will be split into chunks of this size when uploading
201
- const b3 = await mobiletto('b2', b2_key_id, b2_app_key, {bucket: 'bk', partSize: 10000000})
202
-
203
- // List files
204
- api.list() // --> returns an array of metadata objects
205
-
206
- // List files recursively
207
- api.list({ recursive: true })
208
-
209
- // List files in a directory
210
- const path = 'some/path'
211
- api.list(path)
212
- api.list(path, { recursive: true }) // also supports recursive flag
213
-
214
- // Visit files in a directory -- visitor function must be async
215
- api.list(path, { visitor: myAsyncFunc })
216
- api.list(path, { visitor: myAsyncFunc, recursive: true })
217
-
218
- // The `list` method throws MobilettoNotFoundError if the path does not exist
219
- // When you call `safeList` on a non-existent path, it returns an empty array
220
- api.safeList('/path/that/does/not/exist') // returns []
221
-
222
- // Read metadata for a file
223
- api.metadata(path) // returns metadata object
224
-
225
- // The `metadata` method throws MobilettoNotFoundError if the path does not exist
226
- // When you call `safeMetadata` on a non-existent path, it returns null
227
- api.safeMetadata('/tmp/does_not_exist') // returns null
228
-
229
- // Read a file
230
- // Provide a callback that writes the data someplace
231
- const callback = (chunk) => { ... write chunk somewhere ... }
232
- api.read(path, callback) // returns count of bytes read
233
-
234
- // Read an entire file at once
235
- const data = await api.readFile(path) // returns a byte Buffer of the file contents
236
-
237
- // Read an entire file at once
238
- // returns null if an exception would otherwise be thrown
239
- const bufferOrNull = await bucket.safeReadFile('some/path')
240
-
241
- // Write a file
242
- // Provide a generator function that yields chunks of data
243
- const generator = function* () {
244
- while ( ... more-data-to-return ... ) {
245
- data = ... load-data ...
246
- yield data
247
- }
248
- }
249
- local.api(path, generator) // returns count of bytes written
250
-
251
- // Write an entire file at once (convenience method)
252
- await api.writeFile(path, bufferOrString) // returns count of bytes written
253
-
254
- // Delete a file
255
- // Quiet param is optional (default false), when set errors will not be thrown if the path does not exist
256
- // Always returns a value or throws an error.
257
- // Return value may be a single string of the file removed, or an array of all files removed (driver-dependent)
258
- const quiet = true
259
- api.remove(path, {quiet}) // returns single path removed
260
-
261
- // Recursively delete a directory and do it quietly (do not report errors)
262
- const recursive = true
263
- const quiet = true
264
- api.remove(path, {recursive, quiet}) // returns array of paths removed
265
-
266
- ## ମେଟାଡାଟା |
267
- ଗୋଟିଏ `metadata` କମାଣ୍ଡ ଗୋଟିଏ ଫାଇଲ୍ ସିଷ୍ଟମ୍ ଏଣ୍ଟ୍ରି ବିଷୟରେ ମେଟାଡାଟା ରିଟର୍ନ କରେ |
268
- ସେହିଭଳି, `list` ରିଟର୍ନ ଭାଲ୍ୟୁ ହେଉଛି ମେଟାଡାଟା ବସ୍ତୁର ଏକ ଆରେ |
269
-
270
- ଏକ ମେଟାଡାଟା ବସ୍ତୁ ଏହିପରି ଦେଖାଯାଏ:
271
-
272
- {
273
- "name": "fully/qualified/path/to/file",
274
- "type": "entry-type",
275
- "size": size-in-bytes,
276
- "ctime": creation-time-epoch-millis,
277
- "mtime": modification-time-epoch-millis
278
- }
279
-
280
- `type` ସମ୍ପତ୍ତି "ଫାଇଲ୍", `dir` , `link` , କିମ୍ବା `special` `file`
281
-
282
- ଡ୍ରାଇଭର ପ୍ରକାର ଉପରେ ନିର୍ଭର କରି, ଏକ `list` ନିର୍ଦ୍ଦେଶ ସମସ୍ତ କ୍ଷେତ୍ର ଫେରସ୍ତ କରିପାରିବ ନାହିଁ | `name` ଏବଂ `type` ଗୁଣ |
283
- ସର୍ବଦା ଉପସ୍ଥିତ ରହିବା ଉଚିତ୍ | ପରବର୍ତ୍ତୀ `metadata` କମାଣ୍ଡ ସମସ୍ତ ଉପଲବ୍ଧ ଗୁଣଗୁଡିକ ଫେରସ୍ତ କରିବ |
284
-
285
- ## ବିକଳ୍ପ ଆମଦାନୀ ଶ style ଳୀ |
286
- ସମ୍ପୁର୍ଣ୍ଣ ସ୍କୋପଡ୍ ମଡ୍ୟୁଲ୍ ଆମଦାନୀ କରନ୍ତୁ ଏବଂ `connect` କାର୍ଯ୍ୟକୁ ବ୍ୟବହାର କରନ୍ତୁ:
287
-
288
- const storage = require('mobiletto')
289
- const opts = {bucket: 'bk', region: 'us-east-1'}
290
- const s3 = await storage.connect('s3', aws_key, aws_secret, opts)
291
- const objectData = await s3.readFile('some/path')
292
-
293
- ## କ୍ୟାଚିଂ
294
- <a href="https://redis.io">ମୋବାଇଲଟୋ</a> ଏକ ରେଡିସ୍ କ୍ୟାଚ୍ ସହିତ ସର୍ବୋତ୍ତମ କାର୍ଯ୍ୟ କରେ |
295
-
296
- ମୋବାଇଲଟୋ 127.0.0.1:6379 ରେ ଏକ ରେଡିସ୍ ଇନଷ୍ଟାଣ୍ଟ ସହିତ ସଂଯୋଗ କରିବାକୁ ଚେଷ୍ଟା କରିବ |
297
-
298
- ଆପଣ ଏଥିରୁ କ either ଣସିଟିକୁ ନବଲିଖନ କରିପାରିବେ:
299
- * `MOBILETTO_REDIS_HOST` env var ସେଟ୍ କରନ୍ତୁ, ମୋବାଇଲଟୋ ଲୋକାଲ୍ ହୋଷ୍ଟ ପରିବର୍ତ୍ତେ ଏଠାରେ ସଂଯୋଗ କରନ୍ତୁ |
300
- * `MOBILETTO_REDIS_PORT` env var ସେଟ୍ କରନ୍ତୁ, ଏହି ପୋର୍ଟ ବ୍ୟବହାର ହେବ |
301
-
302
- ମୋବାଇଲଟୋ ଏହାର ସମସ୍ତ ରେଡିସ୍ ଚାବିକୁ ଉପସର୍ଗ `_mobiletto__` ସହିତ ସଂରକ୍ଷଣ କରିବ | ଆପଣ ଏହାକୁ ପରିବର୍ତ୍ତନ କରିପାରିବେ |
303
- `MOBILETTO_REDIS_PREFIX` env var ସେଟିଂ କରି |
304
-
305
- ଆପଣ `opts.redisConfig` ବସ୍ତୁ ସହିତ ପ୍ରତି-ସଂଯୋଗ କ୍ୟାଚିଂ ମଧ୍ୟ ସେଟ୍ କରିପାରିବେ:
306
-
307
- const redisConfig = {
308
- enabled: true, // optional, default is true. if false other props are ignored
309
- host: '127.0.0.1',
310
- port: 6379,
311
- prefix: '_mobiletto__'
312
- }
313
- const opts = { redisConfig, bucket: 'bk', region: 'us-east-1' }
314
- const s3 = await storage.connect('s3', aws_key, aws_secret, opts)
315
-
316
- ### ରେଡିସ୍ କ୍ୟାଚିଂ ଚାହୁଁନାହାଁନ୍ତି କି?
317
- ଅକ୍ଷମ କରିବାକୁ: ଯେତେବେଳେ ତୁମେ ତୁମର ସଂଯୋଗ ସ୍ଥାପନ କର, ତୁମର `opts.redisConfig` ବସ୍ତୁରେ `enabled: false` ପାସ୍ କର |
318
-
319
- ଯେପରି ନିମ୍ନରେ ଆଲୋଚନା କରାଯାଇଛି, କ୍ୟାଚିଂ ଅକ୍ଷମ କରିବା କାର୍ଯ୍ୟଦକ୍ଷତା ଉପରେ ପ୍ରତିକୂଳ ପ୍ରଭାବ ପକାଇବ ଏବଂ ଅଧିକ ଅନୁରୋଧ ବହନ କରିବ |
320
- ଷ୍ଟୋରେଜ୍ କରିବାକୁ ଯାହା ଆପଣଙ୍କୁ ପ୍ରକୃତରେ ଆବଶ୍ୟକ |
321
-
322
- ### କ୍ୟାଚିଂ ଗାଇଡ୍
323
- ** ଏନକ୍ରିପ୍ଟେଡ୍ ଷ୍ଟୋରେଜ୍ **: ଏନକ୍ରିପ୍ଟେଡ୍ ଷ୍ଟୋରେଜ୍ ପ reading ିବା / ଲେଖିବା ସାଧାରଣ ଅପେକ୍ଷା ଟିକେ ମନ୍ଥର,
324
- କିନ୍ତୁ ଡିରେକ୍ଟୋରୀଗୁଡିକ (ଯାହା କିଛି ଜିନିଷ କରେ) ଚାରିପାଖରେ ନେଭିଗେଟ୍ କରିବା ଯଥେଷ୍ଟ ମହଙ୍ଗା ଅଟେ | ଏକ ରେଡିସ୍ କ୍ୟାଚ୍ ବ୍ୟବହାର କରି |
325
- ଆପଣଙ୍କୁ ଏକ ମହତ୍ performance ପୂର୍ଣ୍ଣ କାର୍ଯ୍ୟଦକ୍ଷତା ବୃଦ୍ଧି କରିବ |
326
-
327
- ଡିଫଲ୍ଟ କ୍ୟାଚ୍ ସୁରକ୍ଷିତ, କିନ୍ତୁ ଯଦି ଆପଣଙ୍କର ବହୁତ ଲେଖା / ଅପସାରଣ କାର୍ଯ୍ୟ ଅଛି ତେବେ ଭଲ ପ୍ରଦର୍ଶନ କରେ ନାହିଁ |
328
- ଯେକ Any ଣସି ଲେଖା କିମ୍ବା ଅପସାରଣ ଅପରେସନ୍ ସମଗ୍ର କ୍ୟାଚ୍କୁ ଅବ alid ଧ କରେ, ପରବର୍ତ୍ତୀ ପଠନଗୁଡ଼ିକ ନିଶ୍ଚିତ କରିବ |
329
- ସର୍ବଶେଷ ପରିବର୍ତ୍ତନଗୁଡ଼ିକ |
330
-
331
- ### CLI ସାଧନଗୁଡ଼ିକ |
332
- ଯଦି ଆପଣ [mobiletto-cli](https://www.npmjs.com/package/mobiletto-cli) ପରି ଏକ CLI ଉପକରଣ ବ୍ୟବହାର କରୁଛନ୍ତି,
333
- ଆପଣ ନିଶ୍ଚିତ ଭାବରେ ରେଡିସ୍ କ୍ୟାଚ୍ ସକ୍ଷମ କରିବାକୁ ଚାହାଁନ୍ତି, ଯେହେତୁ ଏହା `mo` କମାଣ୍ଡର ଆହ୍ୱାନରେ ରହିଥାଏ |
334
-
335
- ## ଦର୍ପଣ |
336
-
337
- // Copy a local filesystem mobiletto to S3
338
- s3.mirror(local)
339
-
340
- // Mirror a local subdirectory from one mobiletto to an S3 mobiletto, with it's own subdirectory
341
- local.mirror(s3, 'some/local-folder', 'some/s3-folder')
342
-
343
- `mirror` କମାଣ୍ଡ୍ ଗୋଟିଏ ମୋବାଇଲ୍ ଟୋଟ୍ ରୁ ଅନ୍ୟ ଫାଇଲ୍ ର ଏକ ଥର କପି କରିଥାଏ |
344
- ସମୟ ସହିତ ଦର୍ପଣକୁ ବଜାୟ ରଖିବା ପାଇଁ ଏହା କ any ଣସି ପ୍ରକ୍ରିୟା ଚଲାଇ ନଥାଏ | ପୁନର୍ବାର `mirror` ନିର୍ଦ୍ଦେଶକୁ ଚଲାନ୍ତୁ |
345
- ଯେକ missing ଣସି ନିଖୋଜ ଫାଇଲଗୁଡ଼ିକୁ ସିଙ୍କ୍ରୋନାଇଜ୍ କରିବାକୁ |
346
-
347
- `mirror` ରୁ ରିଟର୍ନ ମୂଲ୍ୟ ହେଉଛି କେତେ ସରଳ ଫାଇଲ୍ ପାଇଁ କାଉଣ୍ଟର ସହିତ ଏକ ସରଳ ବସ୍ତୁ |
348
- ପ୍ରତିବିମ୍ବିତ ଏବଂ କେତେ ଫାଇଲରେ ତ୍ରୁଟି ଥିଲା:
349
-
350
- {
351
- success: count-of-files-mirrored,
352
- errors: count-of-files-with-errors
353
- }
354
-
355
- ସତର୍କବାଣୀ: ବଡ଼ ଡାଟା ସେଟ୍କୁ ଦର୍ପଣ କରିବା ଅତ୍ୟନ୍ତ ସମୟ ସାପେକ୍ଷ ଏବଂ ବ୍ୟାଣ୍ଡୱିଡଥ୍-ଇଣ୍ଟେନ୍ସିଭ୍ ହୋଇପାରେ |
356
-
357
- `mirror` |
358
- ପାଠକ ଏବଂ ଲେଖକ କିଏ | ଏହାକୁ ଏକ ଆସାଇନମେଣ୍ଟ ଷ୍ଟେଟମେଣ୍ଟ ପରି କଳ୍ପନା କର: "ବାମହାତୀ ମୋବାଇଲ୍" |
359
- ଜିନିଷଟି (ଦର୍ପଣ ତଥ୍ୟ ଲିଖିତ), ଏବଂ "ଡାହାଣ ହାତ ମୋବାଇଲ୍" (
360
- `mirror` ପଦ୍ଧତିକୁ ଯୁକ୍ତି ହେଉଛି ନ୍ୟସ୍ତ ହୋଇଥିବା ମୂଲ୍ୟ (ପ୍ରତିବିମ୍ବିତ ତଥ୍ୟ ପ read ାଯାଏ) |
361
-
362
- ## ସ୍ୱଚ୍ଛ ଏନକ୍ରିପସନ୍ |
363
- ସ୍ୱଚ୍ଛ କ୍ଲାଏଣ୍ଟ ପାର୍ଶ୍ୱ ଏନକ୍ରିପସନ୍ ସକ୍ଷମ କରନ୍ତୁ:
364
-
365
- // Pass encryption parameters
366
- const encryption = {
367
- // key is required, must be >= 16 chars
368
- key: randomstring.generate(128),
369
-
370
- // optional, the default is to derive IV from key
371
- // when set, IV must be >= 16 chars
372
- iv: randomstring.generate(128),
373
-
374
- // optional, the default is aes-256-cbc
375
- algo: 'aes-256-cbc'
376
- }
377
- const api = await mobiletto(driverName, key, secret, opts, encryption)
378
-
379
- // Subsequent write operations will encrypt data (client side) when writing
380
- // Subsequent read operations will decrypt data (client side) when reading
381
-
382
- କଣ ସବୁ ଘଟିଯାଉଛି? ଏକ ପୃଥକ "ଡିରେକ୍ଟୋରୀ ଏଣ୍ଟ୍ରି" (ଡାଇରେଣ୍ଟ୍) ଡିରେକ୍ଟୋରୀ (ଏନକ୍ରିପ୍ଟ) ସେଥିରେ କେଉଁ ଫାଇଲଗୁଡିକ ଅଛି ତାହା ଟ୍ରାକ୍ କରେ |
383
- ଡିରେକ୍ଟୋରୀ (ଓକେ ଡାଇରେକ୍ଟ୍ ଡିରେକ୍ଟୋରୀ) |
384
- * `list` , ତାଲିକାଭୁକ୍ତ ପ୍ରତ୍ୟେକ ପଥକୁ ଡିକ୍ରିପ୍ଟ କରେ | ତାପରେ ପ୍ରତ୍ୟେକ ଫାଇଲ୍ ପାଇଁ ମେଟାଡାଟା ରିଟର୍ନ କରେ |
385
- * `list` a ବହୁ ସଂଖ୍ୟକ ଫାଇଲ୍ ଥିବା ଡିରେକ୍ଟୋରୀ ପାଇଁ |
386
- * `write` କମାଣ୍ଡ ପ୍ରତ୍ୟେକ ପିତାମାତାଙ୍କ ଡାଇରେକ୍ଟ୍ ଡିରେକ୍ଟୋରୀରେ ବାରମ୍ବାର ଫାଇଲ୍ ଲେଖେ | ତାପରେ ଫାଇଲ୍ ଲେଖେ |
387
- ଡିରେକ୍ଟୋରୀ କ୍ରମରେ N = ଗଭୀରତା ସହିତ `write` N ଲେଖିବା କମାଣ୍ଡଗୁଡ଼ିକ O (N) ଲେଖିବ |
388
- * `remove` ଅପସାରଣ” ନିର୍ଦ୍ଦେଶ ସଂପୃକ୍ତ ଡାଇରେଣ୍ଟ୍ ଫାଇଲ୍ ଅପସାରଣ କରେ, ଏବଂ ଏହାର ପିତାମାତା ଯଦି ଖାଲି, ବାରମ୍ବାର; ତାପରେ ଫାଇଲ୍ ଅପସାରଣ କରେ |
389
- ଡି-ଡିରେକ୍ଟୋରୀ କ୍ରମରେ N = ଗଭୀରତା ସହିତ ଅଣ-ପୁନରାବୃତ୍ତିକାରୀ `remove` ଏବଂ ସମ୍ଭବତ as ଯେତେ ଡିଲିଟ୍ ହେବ |
390
- ବଡ଼ ଏବଂ ଗଭୀର ଫାଇଲତନ୍ତ୍ର ଉପରେ ବାରମ୍ବାର `remove` ନିର୍ଦ୍ଦେଶଗୁଡ଼ିକ ମହଙ୍ଗା ହୋଇପାରେ |
391
-
392
- ଧ୍ୟାନ ଦିଅନ୍ତୁ ଯେ କ୍ଲାଏଣ୍ଟ-ସାଇଡ୍ ଏନକ୍ରିପସନ୍ ସକ୍ଷମ ହୋଇଥିଲେ ମଧ୍ୟ, ଆପଣଙ୍କର ଏନକ୍ରିପ୍ଟ ହୋଇଥିବା ସର୍ଭର-ପାର୍ଶ୍ୱରେ ପୂର୍ଣ୍ଣ ଦୃଶ୍ୟମାନତା ସହିତ ଏକ ଶତ୍ରୁ |
393
- ଷ୍ଟୋରେଜ୍, ଚାବି ବିନା ମଧ୍ୟ, ସମୁଦାୟ ଡିରେକ୍ଟୋରୀଗୁଡିକର ସଂଖ୍ୟା ଏବଂ ପ୍ରତ୍ୟେକରେ କେତେ ଫାଇଲ୍ ଅଛି ଏବଂ ସହିତ ଦେଖିପାରିବେ |
394
- କିଛି ପ୍ରୟାସ, ଡିରେକ୍ଟୋରୀ କ୍ରମର କିଛି କିମ୍ବା ସମସ୍ତ ସାମଗ୍ରିକ ଗଠନ ଆବିଷ୍କାର କର |
395
- * ଟିପନ୍ତୁ: ଉନ୍ନତ ସୁରକ୍ଷା ପାଇଁ ଏକ ଅପେକ୍ଷାକୃତ ସମତଳ ସଂରଚନା ବ୍ୟବହାର କରନ୍ତୁ |
396
- ପ୍ରତିଦ୍ୱନ୍ଦ୍ୱୀ ଡିରେକ୍ଟୋରୀ / ଫାଇଲଗୁଡିକର ନାମ ଜାଣିପାରିବେ ନାହିଁ ଯଦି ସେମାନେ ମଧ୍ୟ ଆପଣଙ୍କର ଏନକ୍ରିପସନ୍ ଜାଣନ୍ତି ନାହିଁ |
397
- ଚାବି କିମ୍ବା ଅନ୍ୟଥା ସଫଳତାର ସହିତ ଏନକ୍ରିପସନ୍ ଫାଟିଯାଇଥିଲା | ସମସ୍ତ ବେଟ୍ ବନ୍ଦ!
398
-
399
- ### ପ୍ରଦର୍ଶନ ଏବଂ କ୍ୟାଚିଂ |
400
- ଏନକ୍ରିପ୍ଟେଡ୍ ଷ୍ଟୋରେଜ୍ ଉପରେ ଅପରେସନ୍ ଧୀର ହୋଇପାରେ | ବାରମ୍ବାର ତାଲିକା ଏବଂ ଅପସାରଣ ବହୁତ ଧୀର ହୋଇପାରେ |
401
- ରେଡିସ୍ ମାଧ୍ୟମରେ କ୍ୟାଚିଂ ବହୁତ ସାହାଯ୍ୟ କରେ, କିନ୍ତୁ ଧ୍ୟାନ ଦିଅନ୍ତୁ ଯେ କ୍ୟାଚ୍ ଯେକ any ଣସି ଲେଖା କିମ୍ବା ଅପସାରଣ ଉପରେ ଫ୍ଲାଶ୍ ହୁଏ |
402
-
403
- ## ଚାବି ଘୂର୍ଣ୍ଣନ |
404
- ଆପଣଙ୍କର ନୂତନ ଚାବି ସହିତ ଏକ ମୋବାଇଲଟୋ ସୃଷ୍ଟି କରନ୍ତୁ, ତାପରେ ଏଥିରେ ପୁରୁଣା ତଥ୍ୟକୁ ଦର୍ପଣ କରନ୍ତୁ:
405
-
406
- const storage = require('mobiletto')
407
-
408
- const oldEncryption = { key: .... }
409
- const oldStorage = await storage.connect('s3', aws_key, aws_secret, {bucket: 'bk', region: 'us-east-1'}, oldEncryption)
410
-
411
- const newEncryption = { key: .... }
412
- const newStorage = await storage.connect('s3', aws_key, aws_secret, {bucket: 'zz', region: 'us-east-1'}, newEncryption)
413
-
414
- newStorage.mirror(oldStorage) // if oldStorage is very large, this may take a looooooong time...
415
-
416
- ## ଡ୍ରାଇଭର ଇଣ୍ଟରଫେସ୍ |
417
- ଡ୍ରାଇଭର ହେଉଛି ଯେକ JS ଣସି JS ଫାଇଲ ଯାହା ଏହି ଦସ୍ତଖତ ସହିତ ଏକ 'ଷ୍ଟୋରେଜ୍ କ୍ଲାଏଣ୍ଟ' ଫଙ୍କସନ୍ ରପ୍ତାନି କରେ:
418
-
419
- function storageClient (key, secret, opts)
420
-
421
- * `key` କି": ଏକ ଷ୍ଟ୍ରିଙ୍ଗ୍, ଆପଣଙ୍କର API କି ( `local` ଡ୍ରାଇଭର ପାଇଁ ଏହା ହେଉଛି ଆଧାର ଡିରେକ୍ଟୋରୀ)
422
- * `secret` : ଏକ ଷ୍ଟ୍ରିଙ୍ଗ୍, ଆପଣଙ୍କର API ଗୁପ୍ତ ( `local` ଡ୍ରାଇଭର ପାଇଁ ବାଦ ଦିଆଯାଇପାରେ)
423
- * `opts` : ଏକ ବସ୍ତୁ, ଗୁଣଗୁଡ଼ିକ ପ୍ରତି ଡ୍ରାଇଭର:
424
- * `local` ପାଇଁ, "ଫାଇଲ୍ ମୋଡ୍" ଏବଂ `dirMode` `fileMode` ନିର୍ଣ୍ଣୟ କରେ କିପରି ନୂତନ ସୃଷ୍ଟି ଫାଇଲ୍ ଏବଂ ଡିରେକ୍ଟୋରୀଗୁଡିକ ସୃଷ୍ଟି ହୁଏ |
425
- * `s3` ପାଇଁ, `bucket` ସମ୍ପତ୍ତି ଆବଶ୍ୟକ | ବ properties କଳ୍ପିକ ଗୁଣଗୁଡ଼ିକ ହେଉଛି:
426
- * `region`: the S3 region, default is us-east-1
427
- * `prefix`: a prefix to prepend to all S3 paths, default is the empty string
428
- * `delimiter`: the directory delimiter, default is '/'
429
-
430
- ଷ୍ଟୋରେଜ୍ କ୍ଲାଏଣ୍ଟ୍ ଫଙ୍କସନ୍ ରିଟର୍ନ କରୁଥିବା ବସ୍ତୁ ନିଶ୍ଚିତ ଭାବରେ ଏହି କାର୍ଯ୍ୟଗୁଡ଼ିକୁ ବ୍ୟାଖ୍ୟା କରିବ:
431
-
432
- // Test the driver before using, ensure proper configuration
433
- async testConfig ()
434
-
435
- // List files in path (or from base-directory)
436
- // If recursive is true, list recursively
437
- // If visitor is defined, it will be an async function. await the visitor function on each file found
438
- // Otherwise, perform the listing and return an array of objects
439
- async list (path, recursive = false, visitor = null) // path may be omitted
440
-
441
- // Read metadata for a path
442
- async metadata (path)
443
-
444
- // Read a file
445
- // callback receives a chunk of data. endCallback is called at end-of-stream
446
- async read (path, callback, endCallback = null)
447
-
448
- // Write a file
449
- // driver must be able to handle a generator or a stream
450
- async write (path, generatorOrReadableStream)
451
-
452
- // Remove a file, or recursively delete a directory
453
- // returns a string of a single path removed, or an array of multiple paths removed
454
- async remove (path, recursive = false, quiet = false)
455
-
456
- ## ଲଗିଂ |
457
- ମୋବାଇଲଟୋ [winston](https://www.npmjs.com/package/winston) ଲଗିଂ ଲାଇବ୍ରେରୀ ବ୍ୟବହାର କରେ |
458
-
459
- ଲଗ୍ ** ଫାଇଲ୍ ପଥ ଏବଂ ତ୍ରୁଟି ସନ୍ଦେଶ ଧାରଣ କରିବ, କିନ୍ତୁ ** କଦାପି ** ଚାବି, ରହସ୍ୟ ଧାରଣ କରିବ ନାହିଁ,
460
- କିମ୍ବା ଅନ୍ୟ କ connection ଣସି ସଂଯୋଗ ବିନ୍ୟାସ ସୂଚନା |
461
-
462
- ### ଲଗ୍ ସ୍ତର |
463
- ଗୋଟିଏ ବ୍ୟବହାର କରି ଲଗ ସ୍ତର ସେଟ୍ କରିବାକୁ `MOBILETTO_LOG_LEVEL` ପରିବେଶ ଭେରିଏବଲ୍ ବ୍ୟବହାର କରନ୍ତୁ |
464
- [https://www.npmjs.com/package/winston#logging-levels)(https://www.npmjs.com/package/winston#logging-levels) ରେ ବ୍ୟାଖ୍ୟା କରାଯାଇଥିବା `npm` ସ୍ତରଗୁଡିକ |
465
-
466
- ଡିଫଲ୍ଟ ସ୍ତର ହେଉଛି `error` | ସବୁଠାରୁ କ୍ରିୟାଶୀଳ ସ୍ତର ହେଉଛି `silly` , ଯଦିଓ ବର୍ତ୍ତମାନ ମୋବାଇଲ୍ |
467
- `debug` ତଳେ ଥିବା ସ୍ତରରେ ଲଗ୍ କରେ ନାହିଁ |
468
-
469
- MOBILETTO_LOG_LEVEL=silly # maximum logs!
470
-
471
- ### ଫାଇଲ୍ ଲଗ୍ କରନ୍ତୁ |
472
- ଡିଫଲ୍ଟ ଭାବରେ, ଲଗର୍ କନସୋଲକୁ ଲେଖେ | ଏକ ଫାଇଲ୍ କୁ ଲଗ୍ ପଠାଇବାକୁ, `MOBILETTO_LOG_FILE` ସେଟ୍ କରନ୍ତୁ |
473
- ପରିବେଶ ଭେରିଏବଲ୍ | ଏକ ଫାଇଲ୍ କୁ ଲଗ୍ କରିବାବେଳେ, ଲଗ୍ ଆଉ କନସୋଲରେ ଲେଖାଯିବ ନାହିଁ |
474
-
475
- MOBILETTO_LOG_FILE=/var/my_mobiletto_log
476
-
477
- ଲଗିଂ ବନ୍ଦ କରିବାକୁ:
478
-
479
- MOBILETTO_LOG_FILE=/dev/null
480
-
481
- </pre>