Couchbase C Client
3.3.6
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.
Modules | |
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. | |
Functions | |
int | lcb_mutation_token_is_valid (const lcb_MUTATION_TOKEN *token) |
lcb_RESPCALLBACK | lcb_install_callback (lcb_INSTANCE *instance, int cbtype, lcb_RESPCALLBACK cb) |
lcb_RESPCALLBACK | lcb_get_callback (lcb_INSTANCE *instance, int cbtype) |
const char * | lcb_strcbtype (int cbtype) |
Returns the type of the callback as a string. | |
lcb_STATUS | lcb_respexists_status (const lcb_RESPEXISTS *resp) |
int | lcb_respexists_is_found (const lcb_RESPEXISTS *resp) |
lcb_STATUS | lcb_respexists_error_context (const lcb_RESPEXISTS *resp, const lcb_KEY_VALUE_ERROR_CONTEXT **ctx) |
lcb_STATUS | lcb_respexists_cookie (const lcb_RESPEXISTS *resp, void **cookie) |
lcb_STATUS | lcb_respexists_cas (const lcb_RESPEXISTS *resp, uint64_t *cas) |
lcb_STATUS | lcb_respexists_key (const lcb_RESPEXISTS *resp, const char **key, size_t *key_len) |
lcb_STATUS | lcb_cmdexists_create (lcb_CMDEXISTS **cmd) |
lcb_STATUS | lcb_cmdexists_destroy (lcb_CMDEXISTS *cmd) |
lcb_STATUS | lcb_cmdexists_parent_span (lcb_CMDEXISTS *cmd, lcbtrace_SPAN *span) |
lcb_STATUS | lcb_cmdexists_collection (lcb_CMDEXISTS *cmd, const char *scope, size_t scope_len, const char *collection, size_t collection_len) |
lcb_STATUS | lcb_cmdexists_key (lcb_CMDEXISTS *cmd, const char *key, size_t key_len) |
lcb_STATUS | lcb_cmdexists_timeout (lcb_CMDEXISTS *cmd, uint32_t timeout) |
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_exists (lcb_INSTANCE *instance, void *cookie, const lcb_CMDEXISTS *cmd) |
lcb_STATUS | lcb_respunlock_status (const lcb_RESPUNLOCK *resp) |
lcb_STATUS | lcb_respunlock_error_context (const lcb_RESPUNLOCK *resp, const lcb_KEY_VALUE_ERROR_CONTEXT **ctx) |
lcb_STATUS | lcb_respunlock_cookie (const lcb_RESPUNLOCK *resp, void **cookie) |
lcb_STATUS | lcb_respunlock_cas (const lcb_RESPUNLOCK *resp, uint64_t *cas) |
lcb_STATUS | lcb_respunlock_key (const lcb_RESPUNLOCK *resp, const char **key, size_t *key_len) |
lcb_STATUS | lcb_cmdunlock_create (lcb_CMDUNLOCK **cmd) |
lcb_STATUS | lcb_cmdunlock_destroy (lcb_CMDUNLOCK *cmd) |
lcb_STATUS | lcb_cmdunlock_parent_span (lcb_CMDUNLOCK *cmd, lcbtrace_SPAN *span) |
lcb_STATUS | lcb_cmdunlock_collection (lcb_CMDUNLOCK *cmd, const char *scope, size_t scope_len, const char *collection, size_t collection_len) |
lcb_STATUS | lcb_cmdunlock_key (lcb_CMDUNLOCK *cmd, const char *key, size_t key_len) |
lcb_STATUS | lcb_cmdunlock_cas (lcb_CMDUNLOCK *cmd, uint64_t cas) |
lcb_STATUS | lcb_cmdunlock_timeout (lcb_CMDUNLOCK *cmd, uint32_t timeout) |
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) |
lcb_STATUS | lcb_unlock (lcb_INSTANCE *instance, void *cookie, const lcb_CMDUNLOCK *cmd) |
Typedefs | |
typedef void | lcb_CMDBASE |
typedef void | lcb_RESPBASE |
typedef void(* | lcb_RESPCALLBACK) (lcb_INSTANCE *instance, int cbtype, const lcb_RESPBASE *resp) |
Callback invoked for responses. | |
typedef struct lcb_RESPEXISTS_ | lcb_RESPEXISTS |
typedef struct lcb_CMDEXISTS_ | lcb_CMDEXISTS |
typedef struct lcb_RESPUNLOCK_ | lcb_RESPUNLOCK |
Unlock a previously locked item using lcb_cmdunlock. | |
typedef struct lcb_CMDUNLOCK_ | lcb_CMDUNLOCK |
Enumerations | |
enum | lcb_RESPFLAGS |
Response flags. More... | |
enum | lcb_CALLBACK_TYPE |
The type of response passed to the callback. More... | |
enum | lcb_DURABILITY_LEVEL |
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 |
cbtype
to LCB_CALLBACK_DEFAULT then your 2.x
callbacks will not work.NULL
. It is usually not an error to have a NULL
callback installed. If the callback is NULL
, then the default callback invocation pattern will take place (as desribed above). However it is an error to set the default callback to NULL
. 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 |