diff --git a/handlers/storage.go b/handlers/storage.go index cf3adb9..cea1c45 100644 --- a/handlers/storage.go +++ b/handlers/storage.go @@ -3,6 +3,9 @@ package handlers import ( "crypto/sha1" "encoding/hex" + "io" + "os" + "strings" "github.com/ectrc/snow/aid" "github.com/gofiber/fiber/v2" @@ -79,39 +82,39 @@ func GetCloudStorageFiles(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON([]aid.JSON{ { "uniqueFilename": "DefaultEngine.ini", - "filename": "DefaultEngine.ini", - "hash": hex.EncodeToString(engineHash[:]), - "hash256": hex.EncodeToString(engineHash256[:]), - "length": len(TEMP_STORAGE["DefaultEngine.ini"]), - "contentType": "application/octet-stream", - "uploaded": "2021-01-01T00:00:00.000Z", - "storageType": "S3", - "doNotCache": false, - "storageIds": []string{"primary"}, + "filename": "DefaultEngine.ini", + "hash": hex.EncodeToString(engineHash[:]), + "hash256": hex.EncodeToString(engineHash256[:]), + "length": len(TEMP_STORAGE["DefaultEngine.ini"]), + "contentType": "application/octet-stream", + "uploaded": "2021-01-01T00:00:00.000Z", + "storageType": "S3", + "doNotCache": false, + "storageIds": []string{"primary"}, }, { "uniqueFilename": "DefaultGame.ini", - "filename": "DefaultGame.ini", - "hash": hex.EncodeToString(gameHash[:]), - "hash256": hex.EncodeToString(gameHash256[:]), - "length": len(TEMP_STORAGE["DefaultGame.ini"]), - "contentType": "application/octet-stream", - "uploaded": "2021-01-01T00:00:00.000Z", - "storageType": "S3", - "doNotCache": false, - "storageIds": []string{"primary"}, + "filename": "DefaultGame.ini", + "hash": hex.EncodeToString(gameHash[:]), + "hash256": hex.EncodeToString(gameHash256[:]), + "length": len(TEMP_STORAGE["DefaultGame.ini"]), + "contentType": "application/octet-stream", + "uploaded": "2021-01-01T00:00:00.000Z", + "storageType": "S3", + "doNotCache": false, + "storageIds": []string{"primary"}, }, { "uniqueFilename": "DefaultRuntimeOptions.ini", - "filename": "DefaultRuntimeOptions.ini", - "hash": hex.EncodeToString(runtimeHash[:]), - "hash256": hex.EncodeToString(runtimeHash256[:]), - "length": len(TEMP_STORAGE["DefaultRuntimeOptions.ini"]), - "contentType": "application/octet-stream", - "uploaded": "2021-01-01T00:00:00.000Z", - "storageType": "S3", - "doNotCache": false, - "storageIds": []string{"primary"}, + "filename": "DefaultRuntimeOptions.ini", + "hash": hex.EncodeToString(runtimeHash[:]), + "hash256": hex.EncodeToString(runtimeHash256[:]), + "length": len(TEMP_STORAGE["DefaultRuntimeOptions.ini"]), + "contentType": "application/octet-stream", + "uploaded": "2021-01-01T00:00:00.000Z", + "storageType": "S3", + "doNotCache": false, + "storageIds": []string{"primary"}, }, }) } @@ -119,13 +122,13 @@ func GetCloudStorageFiles(c *fiber.Ctx) error { func GetCloudStorageConfig(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(aid.JSON{ "enumerateFilesPath": "/api/cloudstorage/system", - "enableMigration": true, - "enableWrites": true, - "epicAppName": "Live", - "isAuthenticated": true, - "disableV2": true, - "lastUpdated": "0000-00-00T00:00:00.000Z", - "transports": []string{}, + "enableMigration": true, + "enableWrites": true, + "epicAppName": "Live", + "isAuthenticated": true, + "disableV2": true, + "lastUpdated": "0000-00-00T00:00:00.000Z", + "transports": []string{}, }) }