DittoConfigConnect

public enum DittoConfigConnect
extension DittoConfigConnect: Codable

Specifies how this instance discovers and connects to peers, including network settings and authentication options. This is a substructure of DittoConfig.

  • Connects this Ditto instance to a Big Peer at the specified URL.

    Important

    For sync to work with server connections, Ditto requires (a) a DittoAuthenticationExpirationHandler to be set via ditto.auth.expirationHandler, and (b) that handler to properly authenticate when requested. start() will throw if the expiration handler is nil.

    Declaration

    Swift

    case server(url: URL)
  • Restricts connectivity to small peers only, optionally using a shared secret (in the form of a private key) for authentication.

    If a privateKey is provided, it will be used as a shared secret for authenticating peer-to-peer connections. The default value is nil, which means no encryption is used in transit.

    Declaration

    Swift

    case smallPeersOnly(privateKey: String? = nil)

Codable

  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws