Line data Source code
1 : import 'package:at_client/at_client.dart';
2 :
3 : /// Class to hold attributes for client preferences.
4 : /// Set the preferences for your application and pass it to [AtClientManager.setCurrentAtSign].
5 : class AtClientPreference {
6 : /// Local device path of hive storage
7 : String? hiveStoragePath;
8 :
9 : /// Local device path of commit log
10 : String? commitLogPath;
11 :
12 : /// Syncing strategy of the client [SyncStrategy]
13 : /// [Deprecated] Use [SyncService]
14 : @Deprecated("Use [SyncService]")
15 : SyncStrategy? syncStrategy;
16 :
17 : /// Specify whether local store is required
18 : bool isLocalStoreRequired = false;
19 :
20 : /// Shared secret of the atSign
21 : String? cramSecret;
22 :
23 : /// Private key of the atSign
24 : String? privateKey;
25 :
26 : /// Specifies the namespace of an app.
27 : String? namespace;
28 :
29 : /// Secret key to encrypt keystore data
30 : List<int>? keyStoreSecret;
31 :
32 : /// Domain of the root server. Defaults to root.atsign.wtf
33 : String rootDomain = 'root.atsign.wtf';
34 :
35 : /// Port of the root server. Defaults to 64
36 : int rootPort = 64;
37 :
38 : /// Frequency of sync task to run in minutes. Defaults to 10 minutes.
39 : int syncIntervalMins = 10;
40 :
41 : /// Idle time in milliseconds of connection to secondary server. Default to 10 minutes.
42 : int outboundConnectionTimeout = 600000;
43 :
44 : /// Maximum data size a secondary can store. Temporary solution. Have to fetch this from
45 : /// server using stats verb.
46 : int maxDataSize = 512000;
47 :
48 : /// Default path to download stream files
49 : String? downloadPath;
50 :
51 : /// regex to perform sync
52 : String? syncRegex;
53 :
54 : /// Number of keys to batch for sync to secondary server
55 : int syncBatchSize = 5;
56 :
57 : /// The number of keys to pull from cloud secondary to local secondary in a single call.
58 : int syncPageLimit = 10;
59 : }
60 :
61 : @Deprecated("Use SyncService")
62 7 : enum SyncStrategy {
63 : /// Sync local keys immediately to secondary server for update and delete commands.
64 : immediate,
65 : onDemand,
66 :
67 : /// Sync periodically once every time interval specified by [AtClientPreference.syncIntervalMins].
68 : scheduled
69 : }
|