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