|
Couchbase C Client
3.3.19
Asynchronous C Client for Couchbase
|
Preview APIs for performing commands.
Basic command and structure definitions for public API. This represents the "V3" API of libcouchbase. This API replaces the legacy API (which now wraps this one). It contains common definitions for scheduling, response structures and callback signatures.
Topics | |
| Read | |
| Retrieve a document from the cluster. | |
| Read (Replica) | |
| Retrieve a document from a replica if it cannot be fetched from the primary. | |
| Create/Update | |
| Set the value of a document. | |
| Open Bucket | |
| Open bucket in cluster. | |
| Remove | |
| Remove documents. | |
| Counters | |
| Manipulate the numeric content of a document. | |
| lcb_RESPCALLBACK lcb_install_callback | ( | lcb_INSTANCE * | instance, |
| int | cbtype, | ||
| lcb_RESPCALLBACK | cb ) |
Install a new-style callback for an operation. The callback will be invoked with the relevant response structure.
| instance | the handle |
| cbtype | the type of operation for which this callback should be installed. The value should be one of the lcb_CALLBACK_TYPE constants |
| cb | the callback to install |
| lcb_RESPCALLBACK lcb_get_callback | ( | lcb_INSTANCE * | instance, |
| int | cbtype ) |
Get the current callback installed as cbtype. Note that this does not perform any kind of resolution (as described in lcb_install_callback3) and will only return a non-NULL value if a callback had specifically been installed via lcb_install_callback3() with the given cbtype.
| instance | the handle |
| cbtype | the type of callback to retrieve |
| const char * lcb_strcbtype | ( | int | cbtype | ) |
Returns the type of the callback as a string.
This function is helpful for debugging and demonstrative processes.
| cbtype | the type of the callback (the second argument to the callback) |
| lcb_STATUS lcb_cmdexists_on_behalf_of | ( | lcb_CMDEXISTS * | cmd, |
| const char * | data, | ||
| size_t | data_len ) |
| lcb_STATUS lcb_cmdexists_on_behalf_of_extra_privilege | ( | lcb_CMDEXISTS * | cmd, |
| const char * | privilege, | ||
| size_t | privilege_len ) |
| lcb_STATUS lcb_cmdunlock_on_behalf_of | ( | lcb_CMDUNLOCK * | cmd, |
| const char * | data, | ||
| size_t | data_len ) |
| lcb_STATUS lcb_cmdunlock_on_behalf_of_extra_privilege | ( | lcb_CMDUNLOCK * | cmd, |
| const char * | privilege, | ||
| size_t | privilege_len ) |
| typedef void(* lcb_RESPCALLBACK) (lcb_INSTANCE *instance, int cbtype, const lcb_RESPBASE *resp) |
Callback invoked for responses.
| instance | The handle |
| cbtype | The type of callback - or in other words, the type of operation this callback has been invoked for. |
| resp | The response for the operation. Depending on the operation this response structure should be casted into a more specialized type. |
| typedef struct lcb_RESPUNLOCK_ lcb_RESPUNLOCK |
Unlock a previously locked item using lcb_cmdunlock.
| instance | the instance |
| cookie | the context pointer to associate with the command |
| cmd | the command containing the information about the locked key |
| enum lcb_RESPFLAGS |
Response flags.
These provide additional 'meta' information about the response They can be read from the response object with a call like lcb_respXXX_flags, where the XXX is the operation – like get, exists, store, etc... There is also a lcb_respXXX_is_final method which reads the LCB_RESP_F_FINAL flag for those operations that execute the callback multiple times.
| enum lcb_CALLBACK_TYPE |
The type of response passed to the callback.
This is used to install callbacks for the library and to distinguish between responses if a single callback is used for multiple response types.
| enum lcb_DURABILITY_LEVEL |