ReplicatorConfiguration

public class ReplicatorConfiguration

Replicator configuration.

  • The local database to replicate with the replication target.

    Declaration

    Swift

    public let database: Database
  • The replication target to replicate with.

    Declaration

    Swift

    public let target: Endpoint
  • Replicator type indicating the direction of the replicator.

    Declaration

    Swift

    public var replicatorType: ReplicatorType = .pushAndPull
  • The continuous flag indicating whether the replicator should stay active indefinitely to replicate changed documents.

    Declaration

    Swift

    public var continuous: Bool = false
  • The Authenticator to authenticate with a remote target.

    Declaration

    Swift

    public var authenticator: Authenticator?
  • The remote target’s SSL certificate.

    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]?
  • Allows the replicator to continue replicating in the background. The default value is NO, which means that the replicator will suspend itself when the replicator detects that the application is running in the background.

    If setting the value to YES, please ensure that the application requests for extending the background task properly.

    Declaration

    Swift

    public var allowReplicatingInBackground: Bool = false
  • Initializes a ReplicatorConfiguration’s builder with the given local database and the replication target.

    Declaration

    Swift

    public init(database: Database, target: Endpoint)

    Parameters

    database

    The local database.

    target

    The replication target.

  • Initializes a ReplicatorConfiguration’s builder with the given configuration object.

    Declaration

    Swift

    public convenience init(config: ReplicatorConfiguration)

    Parameters

    config

    The configuration object.