Couchbase C Client  3.3.14
Asynchronous C Client for Couchbase

Detailed Description

Broadcast NOOP-like commands to each service in the cluster

Function Documentation

◆ lcb_diag()

lcb_STATUS lcb_diag ( lcb_INSTANCE * instance,
void * cookie,
const lcb_CMDDIAG * cmd )

Returns diagnostics report about network connections.

Stability
Committed
Request
lcb_CMDDIAG cmd = { 0 };
lcb_diag(instance, fp, &cmd);
lcb_STATUS lcb_diag(lcb_INSTANCE *instance, void *cookie, const lcb_CMDDIAG *cmd)
Returns diagnostics report about network connections.
lcb_STATUS lcb_wait(lcb_INSTANCE *instance, lcb_WAITFLAGS flags)
Wait for completion of scheduled operations.
@ LCB_WAIT_DEFAULT
Behave like the old lcb_wait()
Definition couchbase.h:1861
Response
lcb_install_callback(instance, LCB_CALLBACK_DIAG, diag_callback);
void diag_callback(lcb_INSTANCE, int, const lcb_RESPBASE *rb)
{
const lcb_RESPDIAG *resp = (const lcb_RESPDIAG *)rb;
char* json;
size_t json_len;
lcb_STATUS rc = lcb_respdiag_status(resp);
if (rc != LCB_SUCCESS) {
fprintf(stderr, "failed: %s\n", lcb_strerror_short(rc));
} else {
lcb_respdiag_value(resp, &json, &json_len);
if (json) {
fprintf(stderr, "\n%.*s", json_len, json);
}
}
}
LCB_INTERNAL_API const char * lcb_strerror_short(lcb_STATUS error)
Get a shorter textual description of an error message.
lcb_STATUS
Error codes returned by the library.
Definition error.h:213
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition couchbase.h:35
lcb_RESPCALLBACK lcb_install_callback(lcb_INSTANCE *instance, int cbtype, lcb_RESPCALLBACK cb)
@ LCB_CALLBACK_DIAG
lcb_diag()
Definition couchbase.h:491
Parameters
instancethe library handle
cookiethe cookie passed in the callback
cmdcommand structure.
Returns
status code for scheduling.

Enumeration Type Documentation

◆ lcb_PING_STATUS

Status of the service.

Stability
Committed

◆ lcb_PING_SERVICE

Type of the service.

This enumeration is used in PING responses.

Stability
Committed