use static key names in index.json for easy unmarshalling
The current index.json format is rather annoying to unmarshal because the key names are not known until runtime (e.g. "v21.06", and so on).
I came up with the following, that seems to be much easier to unmarshal, at least using Go's json lib:
example
{
"versions": [
{
"name": "edge",
"devices": [
{
"name": "motorola-harpia",
"interfaces": [
{
"name": "sxmo",
"images": [
{
"name": "20210929-0323-postmarketOS-edge-sxmo-1.5.1-motorola-harpia-mainline-modem.img.xz",
"time": "2021-09-29T03:23:00.000Z",
"size": 358629100,
"url": "https://images.postmarketos.org/bpo/edge/motorola-harpia/sxmo/20210929-0323/20210929-0323-postmarketOS-edge-sxmo-1.5.1-motorola-harpia-mainline-modem.img.xz",
"sha256": "f88d5ea98683cd4f8beab8050fbe8f35909f03f73b4efeed9b398aa858a5b048",
"sha512": "a2af2216fe6c42e4f7adbd06827c568269d375a84fd02039b858510e9816fa467d64bd1cdcc84cb1e75d153e53a5f419c6caaa332b12f2265ef7c03814e10b6b"
},
{
"name": "20210915-0302-postmarketOS-edge-sxmo-1.5.1-motorola-harpia-mainline-modem.img.xz",
"time": "2021-09-15T03:02:00.000Z",
"size": 384512544,
"url": "https://images.postmarketos.org/bpo/edge/motorola-harpia/sxmo/20210915-0302/20210915-0302-postmarketOS-edge-sxmo-1.5.1-motorola-harpia-mainline-modem.img.xz",
"sha256": "754813870a9c1a702df4000000670c97284fc867eabf0230734f6b66c85a55d7",
"sha512": "a522a0f4926e409899c63321a061e163290da79a985a998834e0988aa60491e9368cdf8de7bde729479c6727580eb0f243ce6f02b259bf0647e19bdc720eb376"
}
]
},
{
"name": "phosh",
"images": [
{
"name": "20210929-0248-postmarketOS-edge-phosh-12-motorola-harpia-mainline-modem.img.xz",
"time": "2021-09-15T03:02:00.000Z",
"size": 428594436,
"url": "https://images.postmarketos.org/bpo/edge/motorola-harpia/phosh/20210929-0248/20210929-0248-postmarketOS-edge-phosh-12-motorola-harpia-mainline-modem.img.xz",
"sha256": "3f56e5cedb2b58c56c76865006f22bdcefe3aaf941b32694aad1b7cadc47a40c",
"sha512": "11011d1c8796a87e77a813d23ba6ca4d04514d9549c9222247fa135a4e3820efa214408d98383f06f07603791538da2c7e83ca22fffd014d0e4b3ad22da2426f"
}
]
}
]
},
{
"name": "pine64-pinephone",
"interfaces": [
{
"name": "plasma-mobile",
"images": [
{
"name": "20210929-0707-postmarketOS-edge-plasma-mobile-3.3-pine64-pinephone.img.xz",
"time": "2021-09-29T07:07:00.000Z",
"size": 686088380,
"url": "https://images.postmarketos.org/bpo/edge/pine64-pinephone/plasma-mobile/20210929-0707/20210929-0707-postmarketOS-edge-plasma-mobile-3.3-pine64-pinephone.img.xz",
"sha256": "ef93edd31d84dea417c5d9d49d5ea5cbc92bd0429240543e1962db931d60c37e",
"sha512": "458a85f8dd4c2b72840466a1d991b30daad1a69ec7c36d5615a03504ae5862b90cc3db09d7313717486f72c6def341b7d30a666618876bd5f4b1e3dbbe560405"
},
{
"name": "20210929-0707-postmarketOS-edge-plasma-mobile-3.3-pine64-pinephone-installer.img.xz",
"time": "2021-09-29T07:07:00.000Z",
"size": 897163876,
"url": "https://images.postmarketos.org/bpo/edge/pine64-pinephone/plasma-mobile/20210929-0707/20210929-0707-postmarketOS-edge-plasma-mobile-3.3-pine64-pinephone-installer.img.xz",
"sha256": "786b522875b278827913e7466532352b85fb50056a170ea93d7823b5a42b6fd9",
"sha512": "b43a85fec089c91384d528ea76a9e9e13f253fc13f42c07c4899709658d63eff5388efa42ad6b84836ffa69ae0bf12298e1f177654ab97fde2e5ee7206d4bc21"
}
]
}
]
}
]
}
]
}
@ollieparanoid you did the original implementation of this, so wanted your thoughts on this change before I do the work to, well, change it :D
Edited by Administrator