Other Structures

The following structures are available globally.

  • A directory or file in the Ditto working directory. Directories can be traversed by accessing the childItems property. Files won’t have any children.

    See more

    Declaration

    Swift

    public struct DiskUsageItem
    extension DiskUsageItem: Equatable
    extension DiskUsageItem: Hashable
    extension 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 static property returning your custom provider:

    extension DittoAuthenticationProvider {
        static var mySpecialProvider: DittoAuthenticationProvider {
            DittoAuthenticationProvider("my-special-provider")
        }
    }
    

    Then use it conveniently with the login APIs like so:

    ditto.auth.login(token: ..., provider: .mySpecialProvider)
    
    See more

    Declaration

    Swift

    public struct DittoAuthenticationProvider
    extension DittoAuthenticationProvider: Hashable
    extension DittoAuthenticationProvider: Equatable
    extension 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.

    Warning

    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.
    See more

    Declaration

    Swift

    public struct DittoConfigExperimental
    extension DittoConfigExperimental: Equatable
    extension DittoConfigExperimental: Hashable
    extension DittoConfigExperimental: Codable
  • Represents a diff between two arrays.

    Create a diff between arrays of DittoQueryResultItems using a DittoDiffer.

    See more

    Declaration

    Swift

    public struct DittoDiff
    extension DittoDiff: Decodable
    extension DittoDiff: Equatable
  • P2P BluetoothLE configuration. Part of DittoPeerToPeer.

    See more

    Declaration

    Swift

    public struct DittoBluetoothLEConfig : Codable, Equatable
  • P2P LAN configuration to configure peer discovery via mDNS or multicast. Part of DittoPeerToPeer.

    See more

    Declaration

    Swift

    public struct DittoLANConfig : Codable, Equatable
  • P2P AWDL configuration. Part of DittoPeerToPeer.

    See more

    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 DittoTransportConfig.

    See more

    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 more

    Declaration

    Swift

    public struct DittoConnect : Equatable
    extension DittoConnect: Codable
  • TCP listening configuration.

    See more

    Declaration

    Swift

    public struct DittoTCPListenConfig : Codable, Equatable
  • HTTP & WebSocket listening configuration.

    See more

    Declaration

    Swift

    public struct DittoHTTPListenConfig : Equatable
    extension 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 more

    Declaration

    Swift

    public struct DittoListen : Codable, Equatable
  • Settings not associated with any specific type of transport.

    See more

    Declaration

    Swift

    public struct DittoGlobalConfig : Codable, Equatable
  • Represents a connection between two peers in a Ditto mesh network.

    See more

    Declaration

    Swift

    public struct DittoConnection
    extension DittoConnection: Identifiable
    extension DittoConnection: Equatable
    extension DittoConnection: Hashable
    extension DittoConnection: Codable
  • Represents a peer in a Ditto mesh network.

    See more

    Declaration

    Swift

    public struct DittoPeer
    extension DittoPeer: Equatable
    extension DittoPeer: Hashable
    extension DittoPeer: Codable
  • Represents the Ditto mesh network of peers and their connections between each other. The localPeer is the entry point, all others are remote peers known by the local peer (either directly or via other remote peers).

    See more

    Declaration

    Swift

    public struct DittoPresenceGraph
    extension DittoPresenceGraph: Equatable
    extension DittoPresenceGraph: Hashable
    extension DittoPresenceGraph: Codable