diff options
Diffstat (limited to 'src/SMAPI.Web/Framework/ConfigModels')
-rw-r--r-- | src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs | 25 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/ConfigModels/StorageConfig.cs | 18 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/ConfigModels/StorageMode.cs | 15 |
3 files changed, 33 insertions, 25 deletions
diff --git a/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs deleted file mode 100644 index c7b6cb00..00000000 --- a/src/SMAPI.Web/Framework/ConfigModels/MongoDbConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace StardewModdingAPI.Web.Framework.ConfigModels -{ - /// <summary>The config settings for mod compatibility list.</summary> - internal class MongoDbConfig - { - /********* - ** Accessors - *********/ - /// <summary>The MongoDB connection string.</summary> - public string ConnectionString { get; set; } - - /// <summary>The database name.</summary> - public string Database { get; set; } - - - /********* - ** Public method - *********/ - /// <summary>Get whether a MongoDB instance is configured.</summary> - public bool IsConfigured() - { - return !string.IsNullOrWhiteSpace(this.ConnectionString); - } - } -} diff --git a/src/SMAPI.Web/Framework/ConfigModels/StorageConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/StorageConfig.cs new file mode 100644 index 00000000..61cc4855 --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/StorageConfig.cs @@ -0,0 +1,18 @@ +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// <summary>The config settings for cache storage.</summary> + internal class StorageConfig + { + /********* + ** Accessors + *********/ + /// <summary>The storage mechanism to use.</summary> + public StorageMode Mode { get; set; } + + /// <summary>The connection string for the storage mechanism, if applicable.</summary> + public string ConnectionString { get; set; } + + /// <summary>The database name for the storage mechanism, if applicable.</summary> + public string Database { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/ConfigModels/StorageMode.cs b/src/SMAPI.Web/Framework/ConfigModels/StorageMode.cs new file mode 100644 index 00000000..4c2ea801 --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/StorageMode.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// <summary>Indicates a storage mechanism to use.</summary> + internal enum StorageMode + { + /// <summary>Store data in a hosted MongoDB instance.</summary> + Mongo, + + /// <summary>Store data in an in-memory MongoDB instance. This is useful for testing MongoDB storage locally, but will likely fail when deployed since it needs permission to open a local port.</summary> + MongoInMemory, + + /// <summary>Store data in-memory. This is suitable for local testing or single-instance servers, but will cause issues when distributed across multiple servers.</summary> + InMemory + } +} |