60 #define LCB_CMD_BASE \
112 #define LCB_CMD_SET_KEY(cmd, keybuf, keylen) \
113 LCB_KREQ_SIMPLE(&(cmd)->key, keybuf, keylen)
150 #define LCB_RESP_BASE \
166 #define LCB_RESP_SERVER_FIELDS \
176 LCB_RESP_SERVER_FIELDS
405 lcb_datatype_t datatype;
604 #define LCB_CMD_SET_VALUE(scmd, valbuf, vallen) do { \
605 (scmd)->value.vtype = LCB_KV_COPY; \
606 (scmd)->value.u_buf.contig.bytes = valbuf; \
607 (scmd)->value.u_buf.contig.nbytes = vallen; \
734 #define LCB_CMDSTATS_F_KV (1 << 16)
742 LCB_RESP_SERVER_FIELDS
826 typedef struct lcb_MULTICMD_CTX_st {
844 lcb_error_t (*done)(
struct lcb_MULTICMD_CTX_st *ctx,
const void *cookie);
853 void (*fail)(
struct lcb_MULTICMD_CTX_st *ctx);
862 #define LCB_CMDOBSERVE_F_MASTER_ONLY 1<<16
973 LCB_RESP_SERVER_FIELDS
1024 #define LCB_CMDHTTP_F_STREAM 1<<16
1069 const char *
const * headers;
1072 lcb_http_request_t _htreq;
1077 lcb_http3(lcb_t instance,
const void *cookie,
const lcb_CMDHTTP *cmd);
const void * value
Value buffer for the item.
Definition: api3.h:402
lcb_error_t lcb_server_verbosity3(lcb_t instance, const void *cookie, const lcb_CMDVERBOSITY *cmd)
lcb_RESPBASE lcb_RESPTOUCH
Response structure for a touch request.
Definition: api3.h:698
lcb_MULTICMD_CTX * lcb_observe3_ctxnew(lcb_t instance)
Create a new multi context for an observe operation.
The response was a result of a not-my-vbucket error.
Definition: api3.h:193
lcb_http_type_t type
Type of request to issue.
Definition: api3.h:1036
lcb_touch3()
Definition: api3.h:214
No more responses are to be received for this request.
Definition: api3.h:183
Command for retrieving a single item.
Definition: api3.h:388
lcb_observe3_ctxnew()
Definition: api3.h:221
lcb_U64 initial
If the item does not exist on the server (and create is true) then this will be the initial value for...
Definition: api3.h:491
Options for lcb_durability_poll() (wrapper)
Definition: couchbase.h:1897
lcb_replica_t strategy
Strategy to use for selecting a replica.
Definition: api3.h:548
lcb_get3()
Definition: api3.h:211
Response structure for the version command.
Definition: api3.h:971
const char * password
Password to authenticate with, if left empty, will use the credentials passed to lcb_create() ...
Definition: api3.h:1059
lcb_storage_t operation
Must be assigned.
Definition: api3.h:588
Command for counter operations.
Definition: api3.h:483
lcb_verbosity_level_t
level field for lcb_set_verbosity()
Definition: couchbase.h:2266
lcb_SIZE nversion
Length of the version string.
Definition: api3.h:975
lcb_error_t lcb_touch3(lcb_t instance, const void *cookie, const lcb_CMDTOUCH *cmd)
Spool a touch request.
Command for requesting an item from a replica.
Definition: api3.h:546
lcb_remove3()
Definition: api3.h:215
void lcb_sched_leave(lcb_t instance)
Leave the current scheduling context, scheduling the commands within the context to be flushed to the...
lcb_CMDBASE lcb_CMDSTATS
Command structure for stats request The lcb_CMDSTATS::key field should contain the statistics key...
Definition: api3.h:729
void(* lcb_RESPCALLBACK)(lcb_t instance, int cbtype, const lcb_RESPBASE *resp)
Callback invoked for responses.
Definition: api3.h:237
The response was artificially generated inside the client.
Definition: api3.h:190
lcb_CMDBASE lcb_CMDREMOVE
Command for removing an item from the server.
Definition: api3.h:647
lcb_http_method_t
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:2455
lcb_CMDBASE lcb_CMDENDURE
Command structure for endure.
Definition: api3.h:932
lcb_int64_t delta
Delta value.
Definition: api3.h:488
lcb_RESPCALLBACK lcb_get_callback3(lcb_t instance, int cbtype)
lcb_flush3()
Definition: api3.h:220
Response structure for counter operations.
Definition: api3.h:500
const char * host
If set, this must be a string in the form of http://host:port.
Definition: api3.h:1063
const char * value
The value, if any, for the given statistic.
Definition: api3.h:743
lcb_U8 exists_master
True if the item exists in master's cache.
Definition: api3.h:938
lcb_error_t lcb_counter3(lcb_t instance, const void *cookie, const lcb_CMDCOUNTER *cmd)
Spool a single counter operation.
lcb_error_t lcb_get3(lcb_t instance, const void *cookie, const lcb_CMDGET *cmd)
Spool a single get operation.
lcb_error_t lcb_flush3(lcb_t instance, const void *cookie, const lcb_CMDFLUSH *cmd)
lcb_storage_t
operation parameter for lcb_store()
Definition: couchbase.h:1203
lcb_stats3()
Definition: api3.h:217
const char * mcversion
The version string.
Definition: api3.h:974
lcb_error_t lcb_stats3(lcb_t instance, const void *cookie, const lcb_CMDSTATS *cmd)
Spool a request for statistics from the cluster.
void lcb_sched_fail(lcb_t instance)
Fail all commands in the current scheduling context.
lcb_U8 status
Bit set of flags.
Definition: api3.h:877
lcb_http3()
Definition: api3.h:224
Multi Command Context API Some commands (notably, OBSERVE and its higher level equivalent, endue) are handled more efficiently at the cluster side by stuffing multiple items into a single packet.
Definition: api3.h:826
Default callback invoked as a fallback.
Definition: api3.h:210
lcb_error_t lcb_unlock3(lcb_t instance, const void *cookie, const lcb_CMDUNLOCK *cmd)
Unlock a previously locked item using lcb_CMDGET::lock.
lcb_RESPFLAGS
Response flags.
Definition: api3.h:181
lcb_RESPCALLBACK lcb_install_callback3(lcb_t instance, int cbtype, lcb_RESPCALLBACK cb)
lcb_U8 ismaster
Set to true if this response came from the master node.
Definition: api3.h:878
lcb_SIZE nvalue
Length of value.
Definition: api3.h:403
lcb_CMDBASE lcb_CMDTOUCH
Command structure for a touch request.
Definition: api3.h:694
lcb_endure3_ctxnew()
Definition: api3.h:223
lcb_replica_t
Select get-replica mode.
Definition: couchbase.h:1014
lcb_error_t lcb_server_versions3(lcb_t instance, const void *cookie, const lcb_CMDBASE *cmd)
lcb_datatype_t datatype
Ignored for now.
Definition: api3.h:586
Low level structures used by commands for buffers.
int lock
If set to true, the exptime field inside options will take to mean the time the lock should be held...
Definition: api3.h:396
int create
Boolean value.
Definition: api3.h:494
lcb_U8 npersisted
How many nodes was this item persisted to.
Definition: api3.h:940
Response structure when retrieving a single item.
Definition: api3.h:400
lcb_U32 flags
These flags are stored alongside the item on the server.
Definition: api3.h:584
Base response structure for callbacks.
Definition: api3.h:162
const char * content_type
For views, set this to application/json
Definition: api3.h:1051
Structure for performing an HTTP request.
Definition: api3.h:1030
lcb_RESPBASE lcb_RESPREMOVE
Response structure for removal operation.
Definition: api3.h:658
const char * body
If the request requires a body (e.g.
Definition: api3.h:1041
lcb_error_t lcb_rget3(lcb_t instance, const void *cookie, const lcb_CMDGETREPLICA *cmd)
Spool a single get-with-replica request.
Base structure for informational commands from servers This contains an additional lcb_RESPSERVERBASE...
Definition: api3.h:174
Response structure for cluster statistics.
Definition: api3.h:740
lcb_error_t
Error codes returned by the library.
Definition: error.h:425
Response structure for an observe command.
Definition: api3.h:875
lcb_U8 nreplicated
How many nodes was this item replicated to.
Definition: api3.h:941
lcb_U32 ttr
Unused.
Definition: api3.h:880
lcb_VALBUF value
Value to store on the server.
Definition: api3.h:581
Response structure for endure.
Definition: api3.h:935
const char * username
Username to authenticate with, if left empty, will use the credentials passed to lcb_create() ...
Definition: api3.h:1055
lcb_U16 nresponses
Total number of polls needed for this item.
Definition: api3.h:937
lcb_unlock3()
Definition: api3.h:216
lcb_U32 itmflags
User-defined flags for the item.
Definition: api3.h:406
lcb_SIZE nbody
Length of the body for the request.
Definition: api3.h:1044
lcb_server_verbosity3()
Definition: api3.h:219
lcb_server_versions3()
Definition: api3.h:218
Common ABI header for all commands.
Definition: api3.h:99
Command for storing an item to the server.
Definition: api3.h:577
#define LCB_RESP_BASE
Response specific flags.
Definition: api3.h:150
lcb_http_request_t * reqhandle
If non-NULL, will be assigned a handle which may be used to subsequently cancel the request...
Definition: api3.h:1048
lcb_CMDBASE lcb_CMDUNLOCK
Command for lcb_unlock3()
Definition: api3.h:436
lcb_error_t lcb_remove3(lcb_t instance, const void *cookie, const lcb_CMDREMOVE *cmd)
Spool a removal of an item.
lcb_U64 value
Contains the current value after the operation was performed.
Definition: api3.h:503
lcb_counter3()
Definition: api3.h:213
lcb_http_type_t
The type of HTTP request to execute.
Definition: couchbase.h:2427
lcb_error_t lcb_store3(lcb_t instance, const void *cookie, const lcb_CMDSTORE *cmd)
Spool a single storage request.
lcb_store3()
Definition: api3.h:212
lcb_CALLBACKTYPE
The type of response passed to the callback.
Definition: api3.h:209
Structure representing a value to be stored.
Definition: kvbuf.h:100
lcb_MULTICMD_CTX * lcb_endure3_ctxnew(lcb_t instance, const lcb_durability_opts_t *options, lcb_error_t *err)
Return a new command context for scheduling endure operations.
lcb_http_method_t method
HTTP Method to use.
Definition: api3.h:1037
lcb_rget3()
Definition: api3.h:222
void lcb_sched_flush(lcb_t instance)
Request commands to be flushed to the network.
lcb_U8 persisted_master
True if item exists in master's disk.
Definition: api3.h:939
void lcb_sched_enter(lcb_t instance)
Enter a scheduling context.
lcb_RESPBASE lcb_RESPUNLOCK
Response structure for an unlock command.
Definition: api3.h:440
lcb_CMDBASE lcb_CMDOBSERVE
Structure for an observe request.
Definition: api3.h:868
lcb_U32 ttp
Unused.
Definition: api3.h:879