ReplicatorConfiguration

public struct ReplicatorConfiguration

Replicator configuration.

  • The local database to replicate with the target database.

    Declaration

    Swift

    public let database: Database
  • The replication target to replicate with. The replication target can be either a URL to the remote database or a local databaes.

    Declaration

    Swift

    public let target: Any
  • Replication type indicating the direction of the replication. The default value is .pushAndPull which is bidrectional.

    Declaration

    Swift

    public var replicatorType: ReplicatorType
  • Should the replicator stay active indefinitely, and push/pull changed documents?. The default value is false.

    Declaration

    Swift

    public var continuous: Bool
  • The conflict resolver for this replicator. Setting nil means using the default conflict resolver, where the revision with more history wins.

    Declaration

    Swift

    public var conflictResolver: ConflictResolver?
  • An Authenticator to authenticate with a remote server. Currently there are two types of the authenticators, BasicAuthenticator and SessionAuthenticator, supported.

    Declaration

    Swift

    public var authenticator: Authenticator?
  • If this property is non-null, the server is required to have this exact SSL/TLS certificate, or the connection will fail.

    Declaration

    Swift

    public var pinnedServerCertificate: SecCertificate?
  • Extra HTTP headers to send in all requests to the remote target.

    Declaration

    Swift

    public var headers: Dictionary<String, String>?
  • A set of Sync Gateway channel names to pull from. Ignored for push replication. If unset, all accessible channels will be pulled. Note: channels that are not accessible to the user will be ignored by Sync Gateway.

    Declaration

    Swift

    public var channels: [String]?
  • A set of document IDs to filter by: if given, only documents with these IDs will be pushed and/or pulled.

    Declaration

    Swift

    public var documentIDs: [String]?
  • Initialize a ReplicatorConfiguration with the given local database and remote database URL.

    Declaration

    Swift

    public init(withDatabase database: Database, targetURL: URL)

    Parameters

    database

    The local database.

    targetURL

    the target URL.

  • Initialize a ReplicatorConfiguration with the given local database and another local database.

    Declaration

    Swift

    public init(withDatabase database: Database, targetDatabase: Database)

    Parameters

    database

    The local database.

    targetDatabase

    The target database.