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 { get set }
  • The continuous flag indicating whether the replicator should stay active indefinitely to replicate changed documents.

    Declaration

    Swift

    public var continuous: Bool { get set }
  • The Authenticator to authenticate with a remote target.

    Declaration

    Swift

    public var authenticator: Authenticator? { get set }
  • The remote target’s SSL certificate.

    Declaration

    Swift

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

    Declaration

    Swift

    public var headers: Dictionary<String, String>? { get set }
  • 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]? { get set }
  • 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]? { get set }
  • Filter closure for validating whether the documents can be pushed to the remote endpoint. Only documents for which the closure returns true are replicated.

    Declaration

    Swift

    public var pushFilter: ReplicationFilter? { get set }
  • Filter closure for validating whether the documents can be pulled from the remote endpoint. Only documents for which the closure returns true are replicated.

    Declaration

    Swift

    public var pullFilter: ReplicationFilter? { get set }
  • The custom conflict resolver object can be set here. If this value is not set, or set to nil, the default conflict resolver will be applied.

    Declaration

    Swift

    public var conflictResolver: ConflictResolverProtocol? { get set }
  • 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 { get set }
  • 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.