From 7e40421d0eaee613be5b807502eb25fafebde5b1 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 4 Sep 2023 02:18:47 +0200 Subject: Added a lot of utilities --- MxApiExtensions/MxApiExtensionsConfiguration.cs | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 MxApiExtensions/MxApiExtensionsConfiguration.cs (limited to 'MxApiExtensions/MxApiExtensionsConfiguration.cs') 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 AuthHomeservers { get; set; } = new(); + public List 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); + } + } +} -- cgit 1.5.1