diff options
author | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-29 17:19:43 +0200 |
---|---|---|
committer | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-29 17:19:43 +0200 |
commit | b83fc90abacc73262e0f8404cebadf6d64eb10ae (patch) | |
tree | d63b921c9bcdf8d381fc02ecfb0a1dd425ebb561 /FireBase/FirebaseOptions.cs | |
parent | 586d564f3c4c509c1aae931331e96f0382178f80 (diff) | |
parent | 680967aee589e4a8d277044b204de07cbe32f41e (diff) |
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
Merged the stuffs
Diffstat (limited to 'FireBase/FirebaseOptions.cs')
-rw-r--r-- | FireBase/FirebaseOptions.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/FireBase/FirebaseOptions.cs b/FireBase/FirebaseOptions.cs new file mode 100644 index 0000000..9905956 --- /dev/null +++ b/FireBase/FirebaseOptions.cs @@ -0,0 +1,76 @@ +namespace Firebase.Database +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Threading.Tasks; + + using Firebase.Database.Offline; + + using Newtonsoft.Json; + + public class FirebaseOptions + { + public FirebaseOptions() + { + this.OfflineDatabaseFactory = (t, s) => new Dictionary<string, OfflineEntry>(); + this.SubscriptionStreamReaderFactory = s => new StreamReader(s); + this.JsonSerializerSettings = new JsonSerializerSettings(); + this.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; + } + } +} |