Structures
The following structures are available globally.
-
Provides info about the authentication status.
See moreDeclaration
Swift
public struct DittoAuthenticationStatus : Equatable
-
A configuration object specifying which network transports Ditto should use to sync data.
A Ditto object comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing a DittoTransportConfig, adjusting its properties, and supplying it to setTransportConfig() on Ditto.
When you initialize a DittoTransportConfig yourself it starts with all transports disabled. You must enable each one directly.
Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured inside the peerToPeer property. To turn each one on, set its enabled property to true.
To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the connect configuration. These are either “host:port” strings for raw TCP sync, or a “wss://…” URL for websockets.
The listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of listen can result in insecure configurations.
See moreDeclaration
Swift
public struct DittoTransportConfig
-
Provides information about the changes that have occurred in relation to an event delivered when observing the collections in a
See moreDittoStore
. It contains information about the collections that are known about as well as the collections that were previously known about in the previous event, along with information about what collections have been inserted, deleted, updated, or moved since the last event.Declaration
Swift
public struct DittoCollectionsEvent
extension DittoCollectionsEvent: CustomStringConvertible, CustomDebugStringConvertible
-
An identifier for a
DittoDocument
.Each
See moreDittoDocumentID
represents a unique identifier for a document.Declaration
Swift
public struct DittoDocumentID : Hashable
extension DittoDocumentID: CustomStringConvertible, CustomDebugStringConvertible
extension DittoDocumentID: ExpressibleByStringLiteral
extension DittoDocumentID: ExpressibleByBooleanLiteral
extension DittoDocumentID: ExpressibleByIntegerLiteral
extension DittoDocumentID: ExpressibleByArrayLiteral
extension DittoDocumentID: ExpressibleByDictionaryLiteral
-
Provides an interface to specify a path to a key in a document ID that you can then call a function on to get the value at the specified key as a specific type. You obtain a
See moreDittoDocumentIDPath
by subscripting aDittoDocumentID
and you can then further subscript aDittoDocumentIDPath
to further specify the key of the document ID that you want to get the value of. This is only really useful if you’re working with a document ID whose underlying value is a dictionary or an array.Declaration
Swift
public struct DittoDocumentIDPath
-
Provides an interface to specify a path to a key in a document that you can then call a function on to get the value at the specified key as a specific type. You obtain a
See moreDittoDocumentPath
by subscripting aDittoDocument
and you can then further subscript aDittoDocumentPath
to further specify the key of the document that you want to get the value of.Declaration
Swift
public struct DittoDocumentPath
-
Provides information about the changes that have occurred in relation to a live query for a given update event.
This type is returned in the
See moreupdate
case of theDittoLiveQueryEvent
enum.Declaration
Swift
public struct DittoLiveQueryUpdate
-
Provides information about a live query event relating to a single document live query.
See moreDeclaration
Swift
public struct DittoSingleDocumentLiveQueryEvent
-
A summary snapshot of the types of connections currently active to a remote Ditto peer.
See moreDeclaration
Swift
public struct DittoRemotePeer : Codable
extension DittoRemotePeer: Identifiable