diff --git a/settings/settings.go b/settings/settings.go index b0006b1..f6ae397 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -15,14 +15,14 @@ const ( type FileSystemType int type Settings struct { - Endpoint string - Token string - StorageProvider StorageSettings + Endpoint string `json:"endpoint"` + Token string `json:"token"` + StorageProvider StorageSettings `json:"storage_provider"` } type StorageSettings struct { - Type FileSystemType - BasePath string + Type FileSystemType `json:"type"` + BasePath string `json:"base_path"` } func parseSettings(data []byte) Settings { diff --git a/settings/settings_test.go b/settings/settings_test.go index 2610eab..30f6908 100644 --- a/settings/settings_test.go +++ b/settings/settings_test.go @@ -13,9 +13,9 @@ func TestSettingsParsing(t *testing.T) { const file string = `{ "endpoint": "0.0.0.0:8000", "token": "foobar", - "storageProvider": { + "storage_provider": { "type": 0, - "basePath": "assets" + "base_path": "assets" } }`