LiteCore
Couchbase Lite cross-platform core implementation
Loading...
Searching...
No Matches
c4Replicator.h File Reference

Go to the source code of this file.

Functions

CBL_CORE_API bool c4repl_isValidDatabaseName (C4String dbName)
 Checks whether a database name is valid, for purposes of appearing in a replication URL.
 
NODISCARD CBL_CORE_API bool c4repl_isValidRemote (C4Address remoteAddress, C4String remoteDatabaseName, C4Error *outError)
 Checks whether the destination of a replication is valid.
 
NODISCARD CBL_CORE_API bool c4address_fromURL (C4String url, C4Address *address, C4String *dbName)
 A simple URL parser that populates a C4Address from a URL string.
 
CBL_CORE_API C4StringResult c4address_toURL (C4Address address)
 Converts a C4Address to a URL.
 
NODISCARD CBL_CORE_API C4Replicatorc4repl_new (C4Database *db, C4Address remoteAddress, C4String remoteDatabaseName, C4ReplicatorParameters params, C4String logPrefix, C4Error *outError)
 Creates a new networked replicator.
 
NODISCARD CBL_CORE_API C4Replicatorc4repl_newWithSocket (C4Database *db, C4Socket *openSocket, C4ReplicatorParameters params, C4String logPrefix, C4Error *outError)
 Creates a new replicator from an already-open C4Socket.
 
CBL_CORE_API void c4repl_start (C4Replicator *repl, bool reset)
 Tells a replicator to start.
 
CBL_CORE_API void c4repl_stop (C4Replicator *repl)
 Tells a replicator to stop.
 
NODISCARD CBL_CORE_API bool c4repl_retry (C4Replicator *repl, C4Error *outError)
 Tells a replicator that's in the offline state to reconnect immediately.
 
CBL_CORE_API void c4repl_setHostReachable (C4Replicator *repl, bool reachable)
 Informs the replicator whether it's considered possible to reach the remote host with the current network configuration.
 
CBL_CORE_API void c4repl_setSuspended (C4Replicator *repl, bool suspended)
 Puts the replicator in or out of "suspended" state.
 
CBL_CORE_API void c4repl_setOptions (C4Replicator *repl, C4Slice optionsDictFleece)
 Sets the replicator's options dictionary.
 
CBL_CORE_API C4ReplicatorStatus c4repl_getStatus (C4Replicator *repl)
 Returns the current state of a replicator.
 
CBL_CORE_API C4Slice c4repl_getResponseHeaders (C4Replicator *repl)
 Returns the HTTP response headers as a Fleece-encoded dictionary.
 
CBL_CORE_API C4SliceResult c4repl_getPendingDocIDs (C4Replicator *repl, C4CollectionSpec spec, C4Error *outErr)
 Gets a fleece encoded list of IDs of documents who have revisions pending push.
 
NODISCARD CBL_CORE_API bool c4repl_isDocumentPending (C4Replicator *repl, C4String docID, C4CollectionSpec spec, C4Error *outErr)
 Checks if the document with the given ID has revisions pending push.
 
NODISCARD CBL_CORE_API C4Certc4repl_getPeerTLSCertificate (C4Replicator *repl, C4Error *outErr)
 Gets the TLS certificate, if any, that was sent from the remote server (NOTE: Only functions when using BuiltInWebSocket)
 
NODISCARD CBL_CORE_API bool c4repl_setProgressLevel (C4Replicator *repl, C4ReplicatorProgressLevel level, C4Error *outErr)
 Sets the progress level of the replicator, indicating what information should be provided via callback.
 
NODISCARD CBL_CORE_API bool c4db_setCookie (C4Database *db, C4String setCookieHeader, C4String fromHost, C4String fromPath, bool acceptParentDomain, C4Error *outError)
 Takes the value of a "Set-Cookie:" header, received from the given host, from an HTTP request with the given path, and saves the cookie into the database's cookie store.
 
CBL_CORE_API C4StringResult c4db_getCookies (C4Database *db, C4Address request, C4Error *error)
 Locates any saved HTTP cookies relevant to the given request, and returns them as a string that can be used as the value of a "Cookie:" header.
 
CBL_CORE_API void c4db_clearCookies (C4Database *db)
 Removes all cookies from the database's cookie store.