17 #ifndef LCB_APILEGACY_H
18 #define LCB_APILEGACY_H
24 #ifndef LIBCOUCHBASE_COUCHBASE_H
25 #error "include <libcouchbase/couchbase.h> first!"
37 #define LCB__HKFIELDS \
43 const void *hashkey; \
126 typedef struct lcb_get_cmd_st {
249 typedef struct {
const void *key; lcb_SIZE nkey; LCB__HKFIELDS } lcb_GETREPLICACMDv0;
267 typedef struct lcb_get_replica_cmd_st {
270 lcb_GETREPLICACMDv0 v0;
347 const void *command_cookie,
364 typedef struct lcb_unlock_cmd_st {
396 typedef void (*lcb_unlock_callback)(
lcb_t instance,
402 lcb_unlock_callback lcb_set_unlock_callback(
lcb_t, lcb_unlock_callback);
437 const void *command_cookie,
470 typedef struct lcb_store_cmd_st {
508 typedef void (*lcb_store_callback)(
lcb_t instance,
const void *cookie,
520 lcb_store_callback lcb_set_store_callback(
lcb_t, lcb_store_callback callback);
569 lcb_error_t lcb_store(
lcb_t instance,
const void *command_cookie, lcb_SIZE num,
613 typedef struct lcb_arithmetic_cmd_st {
635 } lcb_arithmetic_resp_t;
648 typedef void (*lcb_arithmetic_callback)
649 (
lcb_t instance,
const void *cookie,
lcb_error_t error,
const lcb_arithmetic_resp_t *resp);
653 lcb_arithmetic_callback lcb_set_arithmetic_callback(
lcb_t, lcb_arithmetic_callback);
692 const void *command_cookie,
702 LCB_OBSERVE_MASTER_ONLY = 0x01
703 } lcb_observe_options_t;
705 #define LCB_OBSERVE_FIELDS_COMMON \
711 LCB_OBSERVE_FIELDS_COMMON
716 LCB_OBSERVE_FIELDS_COMMON
722 typedef struct lcb_observe_cmd_st {
750 } lcb_observe_resp_t;
761 typedef void (*lcb_observe_callback)(
lcb_t instance,
764 const lcb_observe_resp_t *resp);
767 lcb_observe_callback lcb_set_observe_callback(
lcb_t, lcb_observe_callback);
799 const void *command_cookie,
815 typedef struct lcb_remove_cmd_st {
847 typedef void (*lcb_remove_callback)(
lcb_t instance,
const void *cookie,
851 lcb_remove_callback lcb_set_remove_callback(
lcb_t, lcb_remove_callback);
884 const void *command_cookie,
886 const lcb_remove_cmd_t *
const *commands);
916 typedef void (*lcb_touch_callback)(
lcb_t instance,
919 const lcb_touch_resp_t *resp);
922 lcb_touch_callback lcb_set_touch_callback(
lcb_t, lcb_touch_callback);
980 typedef struct lcb_durability_cmd_st {
1031 typedef struct lcb_durability_resp_st {
1036 } lcb_durability_resp_t;
1142 typedef void (*lcb_durability_callback)(
lcb_t instance,
1145 const lcb_durability_resp_t *res);
1148 lcb_durability_callback lcb_set_durability_callback(
lcb_t,
1149 lcb_durability_callback);
1162 typedef struct lcb_server_stats_cmd_st {
1164 union { lcb_STATSCMDv0 v0; } v;
1165 LCB_DEPR_CTORS_STATS
1166 } lcb_server_stats_cmd_t;
1196 typedef struct lcb_server_stat_resp_st {
1211 typedef void (*lcb_stat_callback)(
lcb_t instance,
1216 lcb_stat_callback lcb_set_stat_callback(
lcb_t, lcb_stat_callback);
1254 const void *command_cookie,
1256 const lcb_server_stats_cmd_t *
const *commands);
1261 typedef struct lcb_server_version_cmd_st {
1263 union {
struct {
const void *notused; } v0; } v;
1264 LCB_DEPR_CTORS_VERSIONS
1265 } lcb_server_version_cmd_t;
1270 typedef struct lcb_server_version_resp_st {
1274 const char *server_endpoint;
1275 const char *vstring;
1310 const void *command_cookie,
1312 const lcb_server_version_cmd_t *
const *commands);
1322 typedef void (*lcb_version_callback)(
lcb_t instance,
1328 lcb_version_callback lcb_set_version_callback(
lcb_t, lcb_version_callback);
1333 } lcb_VERBOSITYCMDv0;
1335 typedef struct lcb_verbosity_cmd_st {
1338 lcb_VERBOSITYCMDv0 v0;
1340 LCB_DEPR_CTORS_VERBOSITY
1341 } lcb_verbosity_cmd_t;
1343 typedef struct lcb_verbosity_resp_st {
1347 const char *server_endpoint;
1350 } lcb_verbosity_resp_t;
1372 const void *command_cookie,
1374 const lcb_verbosity_cmd_t *
const *commands);
1384 typedef void (*lcb_verbosity_callback)(
lcb_t instance,
1387 const lcb_verbosity_resp_t *resp);
1390 lcb_verbosity_callback lcb_set_verbosity_callback(
lcb_t,
1391 lcb_verbosity_callback);
1392 typedef struct lcb_flush_cmd_st {
1394 union {
struct {
int unused; } v0; } v;
1395 LCB_DEPR_CTORS_FLUSH
1398 typedef struct lcb_flush_resp_st {
1402 const char *server_endpoint;
1436 const lcb_flush_cmd_t *
const *commands);
1446 typedef void (*lcb_flush_callback)(
lcb_t instance,
1449 const lcb_flush_resp_t *resp);
1451 lcb_flush_callback lcb_set_flush_callback(
lcb_t, lcb_flush_callback);
1492 const char *content_type;
1494 const char *username;
1495 const char *password;
1502 typedef struct lcb_http_cmd_st {
1551 typedef void (*lcb_http_res_callback)(
1552 lcb_http_request_t request,
lcb_t instance,
const void *cookie,
1555 typedef lcb_http_res_callback lcb_http_data_callback;
1556 typedef lcb_http_res_callback lcb_http_complete_callback;
1567 lcb_http_complete_callback
1568 lcb_set_http_complete_callback(
lcb_t, lcb_http_complete_callback);
1580 lcb_http_data_callback
1581 lcb_set_http_data_callback(
lcb_t, lcb_http_data_callback);
1677 const void *command_cookie,
1680 lcb_http_request_t *request);
lcb_storage_t operation
Mandatory.
Definition: api-legacy.h:465
Wrapper structure for lcb_ARITHCMDv0.
Definition: api-legacy.h:613
lcb_unlock() Command structure
Definition: api-legacy.h:355
wrapper structure for lcb_get_replica()
Definition: api-legacy.h:267
unsigned char exists_master
Whether the key exists on the master.
Definition: api-legacy.h:1015
lcb_S64 delta
This number will be added to the current value on the server; if this is negative then the current va...
Definition: api-legacy.h:602
Options for lcb_endure3_ctxnew() (wrapper)
Definition: couchbase.h:1419
Single-key command structure for lcb_durability_poll()
Definition: api-legacy.h:962
int from_master
zero if key came from replica
Definition: api-legacy.h:740
lcb_unlock() wrapper response structure
Definition: api-legacy.h:380
lcb_verbosity_level_t
level field for lcb_server_verbosity3 ()
Definition: couchbase.h:2245
Response structure for lcb_server_versions()
Definition: api-legacy.h:1270
lcb_observe() Command wrapper structure
Definition: api-legacy.h:722
unsigned char persisted_master
Whether the key was persisted to the master.
Definition: api-legacy.h:1009
lcb_durability_poll() Command wrapper
Definition: api-legacy.h:980
Get Command Structure.
Definition: api-legacy.h:91
lcb_http_method_t
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:2365
lcb_get_callback lcb_set_get_callback(lcb_t, lcb_get_callback callback)
Set the callback to be invoked when an item is received as a result of an lcb_get() operation...
lcb_cas_t cas
CAS representing current mutation state of the item.
Definition: api-legacy.h:141
Inner response structure for a get operation.
Definition: api-legacy.h:135
const char * path
Definition: api-legacy.h:1486
lcb_storage_t
Values for lcb_CMDSTORE::operation.
Definition: couchbase.h:966
lcb_store() Command structure
Definition: api-legacy.h:447
const void * bytes
Statistic value.
Definition: api-legacy.h:1191
Per-server, per-stat response structure for lcb_server_stats()
Definition: api-legacy.h:1187
lcb_U64 initial
If the create field is true, this is the initial value for the counter iff the item does not yet exis...
Definition: api-legacy.h:608
lcb_unlock() Wrapper structure
Definition: api-legacy.h:364
unsigned char npersisted
how many nodes (including master) this item was persisted to
Definition: api-legacy.h:1018
const void * body
The POST body for HTTP request.
Definition: api-legacy.h:1467
lcb_observe_t
Possible statuses for keys in OBSERVE response.
Definition: couchbase.h:1714
lcb_time_t exptime
Expiration time for the item.
Definition: api-legacy.h:581
Command structure for arithmetic operations This is contained within the lcb_arithmetic_cmd_t structu...
Definition: api-legacy.h:575
unsigned char nreplicated
how many nodes (excluding master) this item was replicated to
Definition: api-legacy.h:1021
Structure representing a synchronization token.
Definition: couchbase.h:577
lcb_time_t exptime
If this parameter is specified and lock is not set then the server will also update the object's expi...
Definition: api-legacy.h:102
const char * content_type
The Content-Type header for request.
Definition: api-legacy.h:1477
lcb_SIZE npath
Length of the path.
Definition: api-legacy.h:1466
lcb_replica_t
Select get-replica mode.
Definition: couchbase.h:843
int index
If strategy is LCB_REPLICA_SELECT, specific the replica index to use.
Definition: api-legacy.h:260
LCB__HKFIELDS lcb_observe_options_t options
<@private
Definition: api-legacy.h:717
lcb_time_t ttr
average time to replicate on this server
Definition: api-legacy.h:742
lcb_unlock() response structure
Definition: api-legacy.h:373
Response structure for lcb_durability_poll()
Definition: api-legacy.h:989
lcb_error_t err
if this entry failed, this contains the reason, e.g.
Definition: api-legacy.h:1000
const char * path
Path used for request.
Definition: api-legacy.h:1526
Command for lcb_get_replica()
Definition: api-legacy.h:254
Wrapper structure for lcb_STORERESPv0.
Definition: api-legacy.h:489
int chunked
If true the client will use lcb_http_data_callback to notify about response and will call lcb_http_co...
Definition: api-legacy.h:1473
lcb_replica_t strategy
Strategy to use.
Definition: api-legacy.h:258
lcb_get() Command Wrapper Structure
Definition: api-legacy.h:126
lcb_time_t ttp
average time to persist on this server
Definition: api-legacy.h:741
lcb_cas_t cas
If present, the server will check that the item's current CAS matches the value specified here...
Definition: api-legacy.h:459
lcb_observe_t status
Status flags.
Definition: api-legacy.h:739
const char * server_endpoint
Server which the statistic is from.
Definition: api-legacy.h:1188
const char * path
A view path string with optional query params (e.g.
Definition: api-legacy.h:1465
void(* lcb_get_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp)
The callback function for a "get-style" request.
Definition: api-legacy.h:166
lcb_cas_t cas
You must populate this with the CAS.
Definition: api-legacy.h:358
struct lcb_st * lcb_t
Library handle representing a connection to a data bucket.
Definition: couchbase.h:41
Wrapper structure for lcb_STATSRESPv0.
Definition: api-legacy.h:1196
int create
If the item does not exist on the server, set this to true to force the creation of the item...
Definition: api-legacy.h:588
unsigned short nresponses
Total number of observe responses received for the node.
Definition: api-legacy.h:1028
int lock
If this parameter is set then the server will in addition to retrieving the item also lock the item...
Definition: api-legacy.h:118
lcb_observe() Command structure
Definition: api-legacy.h:715
lcb_error_t
Error codes returned by the library.
Definition: error.h:506
const char *const * headers
List of headers.
Definition: api-legacy.h:1528
lcb_get() response wrapper structure
Definition: api-legacy.h:149
Wrapper structure for lcb_make_http_request.
Definition: api-legacy.h:1502
lcb_time_t exptime
Expiration for the item.
Definition: api-legacy.h:464
const void * bytes
Value to store.
Definition: api-legacy.h:450
Structure for lcb_make_http_request()
Definition: api-legacy.h:1463
const void * body
Definition: api-legacy.h:1488
const void * key
Key to retrieve.
Definition: api-legacy.h:92
lcb_U32 flags
Server side flags stored with the item.
Definition: api-legacy.h:140
lcb_U32 flags
User-defined flags stored along with the item.
Definition: api-legacy.h:452
Response structure received for HTTP requests.
Definition: api-legacy.h:1524
const void * key
Statistic name.
Definition: api-legacy.h:1189
lcb_error_t lcb_get(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_get_cmd_t *const *commands)
Get a number of values from the cache.
lcb_SIZE nkey
Key length.
Definition: api-legacy.h:93
lcb_SIZE nbody
Length of the body.
Definition: api-legacy.h:1468
const void * bytes
Body (if any)
Definition: api-legacy.h:1529
lcb_http_status_t status
HTTP status code.
Definition: api-legacy.h:1525
Wrapper structure for lcb_STORECMDv0.
Definition: api-legacy.h:470
lcb_SIZE nbytes
Length of value to store.
Definition: api-legacy.h:451
lcb_http_type_t
The type of HTTP request to execute.
Definition: couchbase.h:2333
lcb_cas_t cas
CAS of the item on this server.
Definition: api-legacy.h:738
v1 is used by the raw http requests.
Definition: api-legacy.h:1485
lcb_cas_t cas
if found with a different CAS, this is the CAS
Definition: api-legacy.h:1003
Response Structure for lcb_observe()
Definition: api-legacy.h:735