|
Couchbase Lite C
Couchbase Lite C API
|
Go to the source code of this file.
Data Structures | |
| struct | CBLProxySettings |
| Proxy settings for the replicator. More... | |
| struct | CBLCollectionConfiguration |
| The collection and the configuration that can be configured specifically for the replication. More... | |
| struct | CBLReplicatorConfiguration |
| The configuration of a replicator. More... | |
| struct | CBLReplicatorProgress |
| A fractional progress value, ranging from 0.0 to 1.0 as replication progresses. More... | |
| struct | CBLReplicatorStatus |
| A replicator's current status. More... | |
| struct | CBLReplicatedDocument |
| Information about a document that's been pushed or pulled. More... | |
Functions | |
Lifecycle | |
| CBLINLINE const CBLReplicator * | CBLReplicator_Retain (const CBLReplicator *_cbl_nullable t) |
| CBLINLINE void | CBLReplicator_Release (const CBLReplicator *_cbl_nullable t) |
| _cbl_warn_unused CBLReplicator *_cbl_nullable | CBLReplicator_Create (const CBLReplicatorConfiguration *, CBLError *_cbl_nullable outError) |
| Creates a replicator with the given configuration. | |
| const CBLReplicatorConfiguration * | CBLReplicator_Config (CBLReplicator *) |
| Returns the configuration of an existing replicator. | |
| void | CBLReplicator_Start (CBLReplicator *replicator, bool resetCheckpoint) |
| Starts a replicator, asynchronously. | |
| void | CBLReplicator_Stop (CBLReplicator *) |
| Stops a running replicator, asynchronously. | |
| void | CBLReplicator_SetHostReachable (CBLReplicator *, bool reachable) |
| Informs the replicator whether it's considered possible to reach the remote host with the current network configuration. | |
| void | CBLReplicator_SetSuspended (CBLReplicator *repl, bool suspended) |
| Puts the replicator in or out of "suspended" state. | |
Configuration | |
| enum | CBLReplicatorType : uint8_t { kCBLReplicatorTypePushAndPull = 0 , kCBLReplicatorTypePush , kCBLReplicatorTypePull } |
| enum | CBLDocumentFlags : unsigned { kCBLDocumentFlagsDeleted = 1 << 0 , kCBLDocumentFlagsAccessRemoved = 1 << 1 } |
| enum | CBLProxyType : uint8_t { kCBLProxyHTTP , kCBLProxyHTTPS } |
| typedef struct CBLEndpoint | CBLEndpoint |
| An opaque object representing the location of a database to replicate with. | |
| typedef struct CBLAuthenticator | CBLAuthenticator |
| An opaque object representing authentication credentials for a remote server. | |
| typedef bool(* | CBLReplicationFilter) (void *_cbl_nullable context, CBLDocument *document, CBLDocumentFlags flags) |
| A callback that can decide whether a particular document should be pushed or pulled. | |
| typedef const CBLDocument *_cbl_nullable(* | CBLConflictResolver) (void *_cbl_nullable context, FLString documentID, const CBLDocument *_cbl_nullable localDocument, const CBLDocument *_cbl_nullable remoteDocument) |
| Conflict-resolution callback for use in replications. | |
| typedef FLSliceResult(* | CBLDocumentPropertyEncryptor) (void *context, FLString scope, FLString collection, FLString documentID, FLDict properties, FLString keyPath, FLSlice input, FLStringResult *algorithm, FLStringResult *kid, CBLError *error) |
| Callback that encrypts CBLEncryptable properties in the documents pushed by the replicator. | |
| typedef FLSliceResult(* | CBLDocumentPropertyDecryptor) (void *context, FLString scope, FLString collection, FLString documentID, FLDict properties, FLString keyPath, FLSlice input, FLString algorithm, FLString kid, CBLError *error) |
| Callback that decrypts encrypted CBLEncryptable properties in documents pulled by the replicator. | |
| typedef CBLCollectionConfiguration | CBLReplicationCollection |
| Deprecated alias for backward compatibility. | |
| CBL_PUBLIC const FLString | kCBLAuthDefaultCookieName |
| The name of the HTTP cookie used by Sync Gateway to store session keys. | |
| CBL_PUBLIC const CBLConflictResolver | CBLDefaultConflictResolver |
| Default conflict resolver. | |
| _cbl_warn_unused CBLEndpoint *_cbl_nullable | CBLEndpoint_CreateWithURL (FLString url, CBLError *_cbl_nullable outError) |
| Creates a new endpoint representing a server-based database at the given URL. | |
| _cbl_warn_unused CBLEndpoint * | CBLEndpoint_CreateWithLocalDB (CBLDatabase *) |
| Creates a new endpoint representing another local database. | |
| void | CBLEndpoint_Free (CBLEndpoint *_cbl_nullable) |
| Frees a CBLEndpoint object. | |
| _cbl_warn_unused CBLAuthenticator * | CBLAuth_CreatePassword (FLString username, FLString password) |
| Creates an authenticator for HTTP Basic (username/password) auth. | |
| _cbl_warn_unused CBLAuthenticator * | CBLAuth_CreateSession (FLString sessionID, FLString cookieName) |
| Creates an authenticator using a Couchbase Sync Gateway login session identifier, and optionally a cookie name (pass NULL for the default.) | |
| _cbl_warn_unused CBLAuthenticator * | CBLAuth_CreateCertificate (CBLTLSIdentity *identity) |
| Creates an authenticator that presents a client certificate to the server during the initial SSL/TLS handshake. | |
| void | CBLAuth_Free (CBLAuthenticator *_cbl_nullable) |
| Frees a CBLAuthenticator object. | |
Status and Progress | |
| enum | CBLReplicatorActivityLevel : uint8_t { kCBLReplicatorStopped , kCBLReplicatorOffline , kCBLReplicatorConnecting , kCBLReplicatorIdle , kCBLReplicatorBusy } |
| typedef void(* | CBLReplicatorChangeListener) (void *_cbl_nullable context, CBLReplicator *replicator, const CBLReplicatorStatus *status) |
| A callback that notifies you when the replicator's status changes. | |
| typedef void(* | CBLDocumentReplicationListener) (void *context, CBLReplicator *replicator, bool isPush, unsigned numDocuments, const CBLReplicatedDocument *documents) |
| A callback that notifies you when documents are replicated. | |
| CBLReplicatorStatus | CBLReplicator_Status (CBLReplicator *) |
| Returns the replicator's current status. | |
| FLDict _cbl_nullable | CBLReplicator_PendingDocumentIDs (CBLReplicator *, const CBLCollection *collection, CBLError *_cbl_nullable outError) |
| Indicates which documents in the given collection have local changes that have not yet been pushed to the server by this replicator. | |
| bool | CBLReplicator_IsDocumentPending (CBLReplicator *repl, FLString docID, const CBLCollection *collection, CBLError *_cbl_nullable outError) |
| Indicates whether the document with the given ID in the given collection has local changes that have not yet been pushed to the server by this replicator. | |
| FLDict _cbl_nullable | CBLReplicator_PendingDocumentIDs2 (CBLReplicator *, const CBLCollection *collection, CBLError *_cbl_nullable outError) |
| Indicates which documents in the given collection have local changes that have not yet been pushed to the server by this replicator. | |
| bool | CBLReplicator_IsDocumentPending2 (CBLReplicator *repl, FLString docID, const CBLCollection *collection, CBLError *_cbl_nullable outError) |
| Indicates whether the document with the given ID in the given collection has local changes that have not yet been pushed to the server by this replicator. | |
| _cbl_warn_unused CBLListenerToken * | CBLReplicator_AddChangeListener (CBLReplicator *, CBLReplicatorChangeListener, void *_cbl_nullable context) |
| Registers a listener that will be called when the replicator's status changes. | |
| _cbl_warn_unused CBLListenerToken * | CBLReplicator_AddDocumentReplicationListener (CBLReplicator *, CBLDocumentReplicationListener, void *_cbl_nullable context) |
| Registers a listener that will be called when documents are replicated. | |
| _cbl_warn_unused CBLCert *_cbl_nullable | CBLReplicator_ServerCertificate (CBLReplicator *) |
| Gets the TLS certificate received when connecting to the server. | |