diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
commit | e6181c24124d97f2fbc932b8a68311e625463156 (patch) | |
tree | c1f097c344ca266b7941c9668590b0fd35c7870a /dsa/FireBase/FirebaseOptions.cs | |
parent | 2490ad5d31fe2ac778ff9303776f0e91f47a2862 (diff) |
Move dsa related stuff to subfolder
Diffstat (limited to 'dsa/FireBase/FirebaseOptions.cs')
-rw-r--r-- | dsa/FireBase/FirebaseOptions.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dsa/FireBase/FirebaseOptions.cs b/dsa/FireBase/FirebaseOptions.cs new file mode 100644 index 0000000..b4a5e51 --- /dev/null +++ b/dsa/FireBase/FirebaseOptions.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using Firebase.Database.Offline; +using Newtonsoft.Json; + +namespace Firebase.Database +{ + public class FirebaseOptions + { + public FirebaseOptions() + { + OfflineDatabaseFactory = (t, s) => new Dictionary<string, OfflineEntry>(); + SubscriptionStreamReaderFactory = s => new StreamReader(s); + JsonSerializerSettings = new JsonSerializerSettings(); + SyncPeriod = TimeSpan.FromSeconds(10); + } + + /// <summary> + /// Gets or sets the factory for Firebase offline database. Default is in-memory dictionary. + /// </summary> + public Func<Type, string, IDictionary<string, OfflineEntry>> OfflineDatabaseFactory { get; set; } + + /// <summary> + /// Gets or sets the method for retrieving auth tokens. Default is null. + /// </summary> + public Func<Task<string>> AuthTokenAsyncFactory { get; set; } + + /// <summary> + /// Gets or sets the factory for <see cref="TextReader" /> used for reading online streams. Default is + /// <see cref="StreamReader" />. + /// </summary> + public Func<Stream, TextReader> SubscriptionStreamReaderFactory { get; set; } + + /// <summary> + /// Gets or sets the json serializer settings. + /// </summary> + public JsonSerializerSettings JsonSerializerSettings { get; set; } + + /// <summary> + /// Gets or sets the time between synchronization attempts for pulling and pushing offline entities. Default is 10 + /// seconds. + /// </summary> + public TimeSpan SyncPeriod { get; set; } + + /// <summary> + /// Specify if token returned by factory will be used as "auth" url parameter or "access_token". + /// </summary> + public bool AsAccessToken { get; set; } + } +}
\ No newline at end of file |