Other Structures
The following structures are available globally.
-
A directory or file in the Ditto working directory. Directories can be traversed by accessing the
See morechildItemsproperty. Files won’t have any children.Declaration
Swift
public struct DiskUsageItemextension DiskUsageItem: Equatableextension DiskUsageItem: Hashableextension DiskUsageItem: CustomStringConvertible -
Encapsulates the authentication provider used to login.
Important
This API is in preview and provides a type-safe struct for specifying authentication providers, using the extensible-enum pattern. Supports both built-in and custom providers in a consistent and ergonomic way in v5.This struct implements the “extensible enum” pattern, allowing for convenient and type-safe definition and use of authentication providers.
To define a custom authentication provider, extend this type and add a
staticproperty returning your custom provider:extension DittoAuthenticationProvider { static var mySpecialProvider: DittoAuthenticationProvider { DittoAuthenticationProvider("my-special-provider") } }Then use it conveniently with the login APIs like so:
See moreditto.auth.login(token: ..., provider: .mySpecialProvider)Declaration
Swift
public struct DittoAuthenticationProviderextension DittoAuthenticationProvider: Hashableextension DittoAuthenticationProvider: Equatableextension DittoAuthenticationProvider: RawRepresentable -
Experimental configuration options for
DittoConfig.This struct allows you to enable or configure features that are not yet part of the stable API. Use with caution, as experimental features may change or be removed in future releases.
See moreWarning
Experimental functionality should not be used in production applications as it may be changed or removed at any time, and may not have the same security features.Declaration
Swift
public struct DittoConfigExperimentalextension DittoConfigExperimental: Equatableextension DittoConfigExperimental: Hashableextension DittoConfigExperimental: Codable -
Represents a diff between two arrays.
Create a diff between arrays of
See moreDittoQueryResultItems using aDittoDiffer.Declaration
Swift
public struct DittoDiffextension DittoDiff: Decodableextension DittoDiff: Equatable -
P2P BluetoothLE configuration. Part of
See moreDittoPeerToPeer.Declaration
Swift
public struct DittoBluetoothLEConfig : Codable, Equatable -
P2P LAN configuration to configure peer discovery via mDNS or multicast. Part of
See moreDittoPeerToPeer.Declaration
Swift
public struct DittoLANConfig : Codable, Equatable -
P2P AWDL configuration. Part of
See moreDittoPeerToPeer.Declaration
Swift
public struct DittoAWDLConfig : Codable, Equatable -
Configuration of peer-to-peer transports, which are able to discover and connect to peers on their own.
For more information refer to the documentation for
See moreDittoTransportConfig.Declaration
Swift
public struct DittoPeerToPeer : Codable, Equatable -
Specific servers that Ditto should attempt to connect to. TCP servers are specified as “host:port”. WebSocket URLs take the form “wss://hydra.ditto.live”. Please refer to the documentation on Ditto’s website for configuring cloud or client/server scenarios.
See moreDeclaration
Swift
public struct DittoConnect : Equatableextension DittoConnect: Codable -
TCP listening configuration.
See moreDeclaration
Swift
public struct DittoTCPListenConfig : Codable, Equatable -
HTTP & WebSocket listening configuration.
See moreDeclaration
Swift
public struct DittoHTTPListenConfig : Equatableextension DittoHTTPListenConfig: Codable -
Configure this device as a Ditto server. Disabled by default.
This is advanced usage that is not needed in most situations. Please refer to the documentation on Ditto’s website for scenarios and example configurations.
See moreDeclaration
Swift
public struct DittoListen : Codable, Equatable -
Settings not associated with any specific type of transport.
See moreDeclaration
Swift
public struct DittoGlobalConfig : Codable, Equatable -
Represents a connection between two peers in a Ditto mesh network.
See moreDeclaration
Swift
public struct DittoConnectionextension DittoConnection: Identifiableextension DittoConnection: Equatableextension DittoConnection: Hashableextension DittoConnection: Codable -
Represents a peer in a Ditto mesh network.
See moreDeclaration
Swift
public struct DittoPeerextension DittoPeer: Equatableextension DittoPeer: Hashableextension DittoPeer: Codable -
Represents the Ditto mesh network of peers and their connections between each other. The
See morelocalPeeris the entry point, all others are remote peers known by the local peer (either directly or via other remote peers).Declaration
Swift
public struct DittoPresenceGraphextension DittoPresenceGraph: Equatableextension DittoPresenceGraph: Hashableextension DittoPresenceGraph: Codable
Other Structures Reference