Storage: simplify retrieving the file names from the response frame (#51805)

* add util method for storage list frame

* use go:embed

* remove enum
This commit is contained in:
Artur Wierzbicki
2022-07-07 10:47:05 +04:00
committed by GitHub
parent 4f931afe29
commit 052132be46
8 changed files with 267 additions and 23 deletions
+73
View File
@@ -0,0 +1,73 @@
{
"schema": {
"meta": {
"type": "directory-listing",
"custom": {
"HasMore": false
}
},
"fields": [
{
"name": "name",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "mediaType",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "size",
"type": "number",
"typeInfo": {
"frame": "int64"
},
"config": {
"unit": "bytes"
}
}
]
},
"data": {
"values": [
[
"DL_1.jpg",
"Screen Shot 2022-06-23 at 9.05.39 PM.png",
"Screen Shot 2022-06-24 at 11.58.32 AM.png",
"Screen Shot 2022-06-30 at 3.45.03 PM.png",
"Screen Shot 2022-07-05 at 3.24.27 PM.png",
"image.png",
"rocket_1f680.png",
"test-folder",
"topcoder12.png"
],
[
"image/jpeg",
"image/png",
"image/png",
"image/png",
"image/png",
"image/png",
"image/png",
"directory",
"image/png"
],
[
943004,
684257,
256396,
8796,
388290,
182568,
29066,
0,
90563
]
]
}
}
@@ -0,0 +1,90 @@
{
"schema": {
"meta": {
"type": "directory-listing"
},
"fields": [
{
"name": "name",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "title",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "description",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "mediaType",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "storageType",
"type": "string",
"typeInfo": {
"frame": "string"
}
},
{
"name": "readOnly",
"type": "boolean",
"typeInfo": {
"frame": "bool"
}
},
{
"name": "builtIn",
"type": "boolean",
"typeInfo": {
"frame": "bool"
}
}
]
},
"data": {
"values": [
[
"public-static",
"resources"
],
[
"Public static files",
"Resources"
],
[
"Access files from the static public files",
"Upload custom resource files"
],
[
"directory",
"directory"
],
[
"disk",
"sql"
],
[
true,
false
],
[
true,
true
]
]
}
}