|
Ditto 4.13.1
|
A configuration object for initializing a Ditto instance. More...
Public Member Functions | |
| DittoConfig (string databaseId, DittoConfigConnect connect, string persistenceDirectory=null) | |
| Initializes a new instance of the DittoConfig class. | |
Properties | |
| static DittoConfig | Default [get] |
| Gets a default DittoConfig instance with standard settings. | |
| static string | DefaultDatabaseId [get] |
| Gets the default identifier for a Ditto instance. | |
| string | DatabaseId [get, set] |
| Gets or sets the unique identifier for the Ditto database. | |
| DittoConfigConnect | Connect [get, set] |
| Gets or sets the connectivity configuration for this Ditto instance. | |
| string | PersistenceDirectory [get, set] |
| Gets or sets the persistence directory used by Ditto to persist data. | |
A configuration object for initializing a Ditto instance.
DittoConfig encapsulates all the parameters required to configure a Ditto instance, including identity, connectivity, persistence, and experimental features.
Important: This API is in preview and will become the standard way to initialize Ditto instances in v5, replacing the legacy DittoIdentity-based initialization.
|
getset |
Gets or sets the connectivity configuration for this Ditto instance.
Specifies how this instance discovers and connects to peers, including network settings and authentication options.
|
getset |
|
staticget |
Gets a default DittoConfig instance with standard settings.
This is useful as a starting point or for quickly creating a basic configuration, but for production use you should customize the configuration as needed.
|
staticget |
Gets the default identifier for a Ditto instance.
This identifier is used when no explicit Database ID is provided. It is typically a constant UUID string that ensures a predictable default value. In most cases, you should provide your own unique identifier to avoid conflicts when syncing with other peers.
|
getset |
Gets or sets the persistence directory used by Ditto to persist data.
This property accepts the following types of values:
/Users/joe/some/path/to/my-project.ddb. some/path/to/my-project.ddb. null: Ditto will use a default path of the form ditto-{database-id} inside Ditto.DefaultRootDirectory, where {database-id} is the lowercase Ditto database ID specified in the configuration. To obtain the final, resolved absolute path being used after the Ditto instance is created, use Ditto.AbsolutePersistenceDirectory.
Note: "Database ID" was previously referred to as "App ID" in older versions of the SDK.
It is not recommended to directly read from or write to this directory, as its structure and contents are managed by Ditto and may change in future versions.
When DittoLogger is enabled, logs may be written to this directory even after the Ditto instance has been disposed. Refer to the DittoLogger documentation for more details.