diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-04 02:18:47 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-09-04 02:18:47 +0200 |
commit | 7e40421d0eaee613be5b807502eb25fafebde5b1 (patch) | |
tree | af84e4c39fd0c3cfa05e1b66fb566d5cda59607f /MxApiExtensions/MxApiExtensionsConfiguration.cs | |
parent | Code cleanup (diff) | |
download | MxApiExtensions-7e40421d0eaee613be5b807502eb25fafebde5b1.tar.xz |
Added a lot of utilities
Diffstat (limited to 'MxApiExtensions/MxApiExtensionsConfiguration.cs')
-rw-r--r-- | MxApiExtensions/MxApiExtensionsConfiguration.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/MxApiExtensions/MxApiExtensionsConfiguration.cs b/MxApiExtensions/MxApiExtensionsConfiguration.cs new file mode 100644 index 0000000..c3b6297 --- /dev/null +++ b/MxApiExtensions/MxApiExtensionsConfiguration.cs @@ -0,0 +1,29 @@ +namespace MxApiExtensions; + +public class MxApiExtensionsConfiguration { + public MxApiExtensionsConfiguration(IConfiguration config) { + config.GetRequiredSection("MxApiExtensions").Bind(this); + } + + public List<string> AuthHomeservers { get; set; } = new(); + public List<string> Admins { get; set; } = new(); + + public FastInitialSyncConfiguration FastInitialSync { get; set; } = new(); + + public CacheConfiguration Cache { get; set; } = new(); + + + public class FastInitialSyncConfiguration { + public bool Enabled { get; set; } = true; + public bool UseRoomInfoCache { get; set; } = true; + } + + public class CacheConfiguration { + public RoomInfoCacheConfiguration RoomInfo { get; set; } = new(); + + public class RoomInfoCacheConfiguration { + public TimeSpan BaseTtl { get; set; } = TimeSpan.FromMinutes(1); + public TimeSpan ExtraTtlPerState { get; set; } = TimeSpan.FromMilliseconds(100); + } + } +} |