18 #ifndef LIBCOUCHBASE_COUCHBASE_H
19 #define LIBCOUCHBASE_COUCHBASE_H 1
21 #define LCB_CONFIG_MCD_PORT 11210
22 #define LCB_CONFIG_MCD_SSL_PORT 11207
23 #define LCB_CONFIG_HTTP_PORT 8091
24 #define LCB_CONFIG_HTTP_SSL_PORT 18091
25 #define LCB_CONFIG_MCCOMPAT_PORT 11211
28 typedef struct lcb_st *lcb_t;
29 struct lcb_http_request_st;
30 typedef struct lcb_http_request_st *lcb_http_request_t;
36 #include <libcouchbase/sysdefs.h>
37 #include <libcouchbase/assert.h>
38 #include <libcouchbase/visibility.h>
41 #include <libcouchbase/http.h>
42 #include <libcouchbase/configuration.h>
43 #include <libcouchbase/_cxxwrap.h>
49 typedef lcb_U8 lcb_datatype_t;
50 typedef lcb_U32 lcb_USECS;
235 #ifndef __LCB_DOXYGEN__
239 typedef enum { LCB_CONFIG_TRANSPORT_LIST_END = 0, LCB_CONFIG_TRANSPORT_HTTP = 1, LCB_CONFIG_TRANSPORT_CCCP, LCB_CONFIG_TRANSPORT_MAX } lcb_config_transport_t;
240 #define LCB_CREATE_V0_FIELDS const char *host; const char *user; const char *passwd; const char *bucket; struct lcb_io_opt_st *io;
241 #define LCB_CREATE_V1_FIELDS LCB_CREATE_V0_FIELDS lcb_type_t type;
242 #define LCB_CREATE_V2_FIELDS LCB_CREATE_V1_FIELDS const char *mchosts; const lcb_config_transport_t* transports;
243 struct lcb_create_st0 { LCB_CREATE_V0_FIELDS };
244 struct lcb_create_st1 { LCB_CREATE_V1_FIELDS };
245 struct lcb_create_st2 { LCB_CREATE_V2_FIELDS };
257 struct lcb_io_opt_st *
io;
270 struct lcb_create_st0 v0;
271 struct lcb_create_st1 v1;
272 struct lcb_create_st2 v2;
276 #define LCB_CREATEOPT_INIT(cropt, s, iops) do { \
277 memset(cropt, 0, sizeof(*cropt)); \
278 (cropt)->version = 3; \
279 (cropt)->v.v3.connstr = s; \
280 (cropt)->v.v3.iops = iops; \
629 LCB_IO_OPS_INVALID = 0x00,
630 LCB_IO_OPS_DEFAULT = 0x01,
634 LCB_IO_OPS_WINSOCK = 0x03,
635 LCB_IO_OPS_LIBEV = 0x04,
636 LCB_IO_OPS_SELECT = 0x05,
637 LCB_IO_OPS_WINIOCP = 0x06,
638 LCB_IO_OPS_LIBUV = 0x07
647 #ifndef __LCB_DOXYGEN__
649 typedef struct {
const char *sofile;
const char *symbol;
void *cookie; } lcb_IOCREATEOPTS_DSO;
650 typedef struct {
lcb_io_create_fn create;
void *cookie; } lcb_IOCREATEOPS_FUNCTIONPOINTER;
658 lcb_IOCREATEOPTS_DSO v1;
659 lcb_IOCREATEOPS_FUNCTIONPOINTER v2;
708 #define LCB__HKFIELDS \
714 const void *hashkey; \
815 typedef struct lcb_get_cmd_st {
822 #define LCB_DATATYPE_JSON 0x01
935 const void *command_cookie,
1010 typedef struct {
const void *key; lcb_SIZE nkey;
LCB__HKFIELDS } lcb_GETREPLICACMDv0;
1043 typedef struct lcb_get_replica_cmd_st {
1046 lcb_GETREPLICACMDv0 v0;
1075 const void *command_cookie,
1109 typedef struct lcb_unlock_cmd_st {
1176 const void *command_cookie,
1244 typedef struct lcb_store_cmd_st {
1249 LCB_DEPR_CTORS_STORE
1330 const void *command_cookie,
1391 typedef struct lcb_arithmetic_cmd_st {
1396 LCB_DEPR_CTORS_ARITH
1411 } lcb_arithmetic_resp_t;
1426 const lcb_arithmetic_resp_t *resp);
1464 const void *command_cookie,
1494 #define LCB_OBSERVE_FIELDS_COMMON \
1500 LCB_OBSERVE_FIELDS_COMMON
1505 LCB_OBSERVE_FIELDS_COMMON
1511 typedef struct lcb_observe_cmd_st {
1514 lcb_OBSERVECMDv0 v0;
1534 LCB_OBSERVE_MAX = 0x82
1555 } lcb_observe_resp_t;
1569 const lcb_observe_resp_t *resp);
1596 const void *command_cookie,
1623 typedef struct lcb_remove_cmd_st {
1641 lcb_REMOVERESPv0 v0;
1643 } lcb_remove_resp_t;
1657 const lcb_remove_resp_t *resp);
1684 const void *command_cookie,
1686 const lcb_remove_cmd_t *
const *commands);
1730 const lcb_touch_resp_t *resp);
1850 typedef struct lcb_durability_cmd_st {
1897 typedef struct lcb_durability_opts_st {
1947 typedef struct lcb_durability_resp_st {
1952 } lcb_durability_resp_t;
2054 const lcb_durability_resp_t *res);
2079 typedef struct lcb_server_stats_cmd_st {
2081 union { lcb_STATSCMDv0 v0; } v;
2082 LCB_DEPR_CTORS_STATS
2083 } lcb_server_stats_cmd_t;
2113 typedef struct lcb_server_stat_resp_st {
2168 const void *command_cookie,
2170 const lcb_server_stats_cmd_t *
const *commands);
2188 typedef struct lcb_server_version_cmd_st {
2190 union {
struct {
const void *notused; } v0; } v;
2191 LCB_DEPR_CTORS_VERSIONS
2192 } lcb_server_version_cmd_t;
2197 typedef struct lcb_server_version_resp_st {
2201 const char *server_endpoint;
2202 const char *vstring;
2237 const void *command_cookie,
2239 const lcb_server_version_cmd_t *
const *commands);
2286 } lcb_VERBOSITYCMDv0;
2288 typedef struct lcb_verbosity_cmd_st {
2291 lcb_VERBOSITYCMDv0 v0;
2293 LCB_DEPR_CTORS_VERBOSITY
2294 } lcb_verbosity_cmd_t;
2296 typedef struct lcb_verbosity_resp_st {
2300 const char *server_endpoint;
2303 } lcb_verbosity_resp_t;
2325 const void *command_cookie,
2327 const lcb_verbosity_cmd_t *
const *commands);
2340 const lcb_verbosity_resp_t *resp);
2353 typedef struct lcb_flush_cmd_st {
2355 union {
struct {
int unused; } v0; } v;
2356 LCB_DEPR_CTORS_FLUSH
2359 typedef struct lcb_flush_resp_st {
2363 const char *server_endpoint;
2388 const lcb_flush_cmd_t *
const *commands);
2401 const lcb_flush_resp_t *resp);
2446 LCB_HTTP_TYPE_MAX = 3
2456 LCB_HTTP_METHOD_GET = 0,
2457 LCB_HTTP_METHOD_POST = 1,
2458 LCB_HTTP_METHOD_PUT = 2,
2459 LCB_HTTP_METHOD_DELETE = 3,
2460 LCB_HTTP_METHOD_MAX = 4
2495 const char *content_type;
2497 const char *username;
2498 const char *password;
2505 typedef struct lcb_http_cmd_st {
2555 lcb_http_request_t request, lcb_t instance,
const void *cookie,
2570 lcb_http_complete_callback
2583 lcb_http_data_callback
2668 const void *command_cookie,
2671 lcb_http_request_t *request);
2686 lcb_http_request_t request);
2735 #define LCB_GETNODE_UNAVAILABLE "invalid_host:0"
3129 #if !defined(LCB_VERSION_STRING) || defined(__LCB_DOXYGEN__)
3131 #define LCB_VERSION_STRING "unknown"
3134 #if !defined(LCB_VERSION) || defined(__LCB_DOXYGEN__)
3150 #define LCB_VERSION 0x000000
3153 #if !defined(LCB_VERSION_CHANGESET) || defined(__LCB_DOXYGEN__)
3155 #define LCB_VERSION_CHANGESET "0xdeadbeef"
3172 #define LCB_SUPPORTS_SSL 1
3174 #define LCB_SUPPORTS_SNAPPY 2
3233 void lcb_stop_loop(lcb_t instance);
3262 lcb_dump(lcb_t instance, FILE *fp, lcb_U32 flags);
lcb_error_t lcb_server_stats(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_server_stats_cmd_t *const *commands)
Request server statistics.
int lcb_supports_feature(int n)
Execute an arbitrary request against a host and port.
Definition: couchbase.h:2445
int version
Indicates which field in the lcb_CRST_u union should be used.
Definition: couchbase.h:265
Dump memory usage/reservation information about buffers.
Definition: couchbase.h:3241
Specifying this flag adds additional semantics which instruct the library to search additional resour...
Definition: couchbase.h:2721
lcb_error_t(* lcb_io_create_fn)(int version, lcb_io_opt_t *io, void *cookie)
Signature for a loadable plugin's IOPS initializer.
Definition: iops.h:908
lcb_unlock() Wrapper structure
Definition: couchbase.h:1109
No knowledge of the key :)
Definition: couchbase.h:1532
const void * key
Key to retrieve.
Definition: couchbase.h:781
Handle for administrative access.
Definition: couchbase.h:232
void(* lcb_unlock_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp)
The callback function for an unlock request.
Definition: couchbase.h:1141
lcb_error_t lcb_create_io_ops(lcb_io_opt_t *op, const struct lcb_create_io_ops_st *options)
Create a new instance of one of the library-supplied io ops types.
lcb_observe_options_t
Definition: couchbase.h:1485
unsigned char persisted_master
Whether the key was persisted to the master.
Definition: couchbase.h:1925
Wrapper structure for lcb_STORECMDv0.
Definition: couchbase.h:1244
void(* lcb_http_res_callback)(lcb_http_request_t request, lcb_t instance, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp)
Callback invoked for HTTP requests.
Definition: couchbase.h:2554
const char * server_endpoint
Server which the statistic is from.
Definition: couchbase.h:2105
void(* lcb_observe_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp)
The callback function for an observe request.
Definition: couchbase.h:1566
Options for lcb_durability_poll() (wrapper)
Definition: couchbase.h:1897
struct lcb_io_opt_st * io
IO Options.
Definition: couchbase.h:257
lcb_errmap_callback lcb_set_errmap_callback(lcb_t, lcb_errmap_callback)
lcb_observe() Command structure
Definition: couchbase.h:1504
Time is in nanoseconds.
Definition: couchbase.h:3046
lcb_get() response wrapper structure
Definition: couchbase.h:850
lcb_error_t lcb_errmap_default(lcb_t instance, lcb_U16 code)
This may be used in conjunction with the errmap callback if it wishes to fallback for default behavio...
lcb_unlock() response structure
Definition: couchbase.h:1118
lcb_timeunit_t
Time units reported by lcb_get_timings()
Definition: couchbase.h:3045
lcb_U8 datatype
See lcb_VALUEFLAGS.
Definition: couchbase.h:1234
int lcb_is_waiting(lcb_t instance)
Check if instance is blocked in the event loop.
lcb_SIZE nkey
Key length.
Definition: couchbase.h:782
Wrapper structure for lcb_STORERESPv0.
Definition: couchbase.h:1259
lcb_WAITFLAGS
Flags for lcb_wait3()
Definition: couchbase.h:423
lcb_verbosity_level_t
level field for lcb_set_verbosity()
Definition: couchbase.h:2266
Query all the replicas sequentially, retrieving the first successful response.
Definition: couchbase.h:1017
IO Creation for builtin plugins.
Definition: couchbase.h:642
const char * connstr
Connection string.
Definition: couchbase.h:253
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_NEVERNULL.
Definition: couchbase.h:2730
Do not check pending operations before running the event loop.
Definition: couchbase.h:434
lcb_error_t lcb_get_bootstrap_status(lcb_t instance)
Gets the initial bootstrap status.
lcb_error_t lcb_durability_poll(lcb_t instance, const void *cookie, const lcb_durability_opts_t *options, lcb_SIZE ncmds, const lcb_durability_cmd_t *const *cmds)
Schedule a durability check on a set of keys.
Per-server, per-stat response structure for lcb_server_stats()
Definition: couchbase.h:2104
Get a data (memcached) node.
Definition: couchbase.h:2711
Time is in microseconds.
Definition: couchbase.h:3047
void lcb_wait3(lcb_t instance, lcb_WAITFLAGS flags)
Wait for completion of scheduled operations.
const char * lcb_get_node(lcb_t instance, lcb_GETNODETYPE type, unsigned index)
Return a string of host:port for a node of the given type.
lcb_error_t lcb_touch(lcb_t instance, const void *cookie, lcb_SIZE num, const lcb_touch_cmd_t *const *commands)
Touch (set expiration time) on a number of values in the cache.
Command for lcb_get_replica()
Definition: couchbase.h:1030
Single-key command structure for lcb_durability_poll()
Definition: couchbase.h:1833
LCB__HKFIELDS lcb_observe_options_t options
<@private
Definition: couchbase.h:1506
unsigned char npersisted
how many nodes (including master) this item was persisted to
Definition: couchbase.h:1934
void(* lcb_flush_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_flush_resp_t *resp)
The callback function for a flush request.
Definition: couchbase.h:2398
lcb_SIZE npath
Length of the path.
Definition: couchbase.h:2469
Replace the existing object in the cache.
Definition: couchbase.h:1207
void * lcb_mem_alloc(lcb_SIZE size)
Functions to allocate and free memory related to libcouchbase.
Response Structure for lcb_observe()
Definition: couchbase.h:1540
int lcb_cntl_exists(int ctl)
Determine if a specific control code exists.
void(* lcb_touch_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp)
The callback function for a touch request.
Definition: couchbase.h:1727
int lock
If this parameter is set then the server will in addition to retrieving the item also lock the item...
Definition: couchbase.h:807
lcb_http_method_t
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:2455
const void * key
Statistic name.
Definition: couchbase.h:2106
lcb_store_callback lcb_set_store_callback(lcb_t, lcb_store_callback callback)
Set the callback to be received when an item has been stored.
lcb_durability_poll() Command wrapper
Definition: couchbase.h:1850
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: couchbase.h:1386
int from_master
zero if key came from replica
Definition: couchbase.h:1545
lcb_unlock_callback lcb_set_unlock_callback(lcb_t, lcb_unlock_callback)
#define LCB__HKFIELDS
Note that hashkey/groupid is not a supported feature of Couchbase Server and this client...
Definition: couchbase.h:708
void(* lcb_timings_callback)(lcb_t instance, const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max, lcb_U32 total, lcb_U32 maxtotal)
The following function is called for each bucket in the timings histogram when you call lcb_get_timin...
Definition: couchbase.h:3095
Prepend this object to the existing object.
Definition: couchbase.h:1213
Integrate with the libevent loop.
Definition: couchbase.h:633
lcb_U8 check_delete
this flag inverts the sense of the durability check and ensures that the key does not exist ...
Definition: couchbase.h:1886
This union contains the set of current and historical options.
Definition: couchbase.h:269
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.
struct lcb_create_st3 v3
Use this field.
Definition: couchbase.h:273
lcb_error_t lcb_get_timings(lcb_t instance, const void *cookie, lcb_timings_callback callback)
Get the timings histogram.
const void * lcb_get_cookie(lcb_t instance)
Retrieve the cookie associated with this instance.
lcb_io_ops_type_t
Built-in I/O plugins.
Definition: couchbase.h:628
lcb_storage_t
operation parameter for lcb_store()
Definition: couchbase.h:1203
lcb_U8 datatype
Currently unused.
Definition: couchbase.h:843
lcb_observe_t
Possible statuses for keys in OBSERVE response.
Definition: couchbase.h:1524
void(* lcb_remove_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp)
The callback function for a remove request.
Definition: couchbase.h:1654
int index
If strategy is LCB_REPLICA_SELECT, specific the replica index to use.
Definition: couchbase.h:1036
Execute a management API request.
Definition: couchbase.h:2440
Handle for data access (default)
Definition: couchbase.h:231
lcb_U32 lcb_cntl_getu32(lcb_t instance, int cmd)
Retrieve an lcb_U32 setting.
Dump the raw vbucket configuration.
Definition: couchbase.h:3237
lcb_time_t exptime
Expiration time for the item.
Definition: couchbase.h:1359
Get Command Structure.
Definition: couchbase.h:780
lcb_http_data_callback lcb_set_http_data_callback(lcb_t, lcb_http_data_callback)
Set the HTTP data stream callback for streaming responses.
lcb_io_ops_type_t type
The predefined type you want to create.
Definition: couchbase.h:643
Options for lcb_durability_poll()
Definition: couchbase.h:1858
const char * path
A view path string with optional query params (e.g.
Definition: couchbase.h:2468
lcb_error_t lcb_connect(lcb_t instance)
Schedule the initial connection This function will schedule the initial connection for the handle...
lcb_cas_t cas
if found with a different CAS, this is the CAS
Definition: couchbase.h:1919
Definition of all of the error codes used by libcouchbase.
lcb_destroy_callback lcb_set_destroy_callback(lcb_t, lcb_destroy_callback)
Set the callback to be invoked when the instance is destroyed asynchronously.
Time is in milliseconds.
Definition: couchbase.h:3048
Behave like the old lcb_wait()
Definition: couchbase.h:425
lcb_U32 interval
The durability check may involve more than a single call to observe - or more than a single packet se...
Definition: couchbase.h:1874
Add the item to the cache, but fail if the object exists alread.
Definition: couchbase.h:1205
int chunked
If true the client will use lcb_http_data_callback to notify about response and will call lcb_http_co...
Definition: couchbase.h:2476
lcb_error_t lcb_cntl_setu32(lcb_t instance, int cmd, lcb_U32 arg)
Convenience function to set a value as an lcb_U32.
lcb_U32 timeout
Upper limit in microseconds from the scheduling of the command.
Definition: couchbase.h:1864
const void * bytes
Value to store.
Definition: couchbase.h:1224
void lcb_destroy(lcb_t instance)
Destroy (and release all allocated resources) an instance of lcb.
lcb_touch_callback lcb_set_touch_callback(lcb_t, lcb_touch_callback)
const void * bytes
Body (if any)
Definition: couchbase.h:2532
lcb_U32 flags
User-defined flags stored along with the item.
Definition: couchbase.h:1226
lcb_error_t lcb_cntl(lcb_t instance, int mode, int cmd, void *arg)
This function exposes an ioctl/fcntl-like interface to read and write various configuration propertie...
const char *const * lcb_get_server_list(lcb_t instance)
Get a list of nodes in the cluster.
void(* lcb_version_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp)
The callback function for a version request.
Definition: couchbase.h:2249
void lcb_refresh_config(lcb_t instance)
Force the library to refetch the cluster configuration.
lcb_error_t lcb_observe(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_observe_cmd_t *const *commands)
Observe key.
lcb_http_status_t status
HTTP status code.
Definition: couchbase.h:2528
lcb_error_t lcb_arithmetic(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_arithmetic_cmd_t *const *commands)
Perform arithmetic operation on a keys value.
Query all the replicas concurrently, retrieving all the responses.
Definition: couchbase.h:1020
lcb_GETNODETYPE
Type of node to retrieve for the lcb_get_node() function.
Definition: couchbase.h:2707
lcb_replica_t
Select get-replica mode.
Definition: couchbase.h:1014
Command codes for libcouchbase.
lcb_replica_t strategy
Strategy to use.
Definition: couchbase.h:1034
Value is JSON.
Definition: couchbase.h:830
lcb_cas_t cas
You must populate this with the CAS.
Definition: couchbase.h:1103
lcb_error_t lcb_unlock(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_unlock_cmd_t *const *commands)
Unlock the key locked with lcb_get() with the lcb_GETCMDv0::lock option.
lcb_observe_t status
Status flags.
Definition: couchbase.h:1544
unsigned short nresponses
Total number of observe responses received for the node.
Definition: couchbase.h:1944
Structure for lcb_make_http_request()
Definition: couchbase.h:2466
v1 is used by the raw http requests.
Definition: couchbase.h:2488
lcb_error_t lcb_flush(lcb_t instance, const void *cookie, lcb_SIZE num, const lcb_flush_cmd_t *const *commands)
Flush the entire couchbase cluster!
void(* lcb_verbosity_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_verbosity_resp_t *resp)
The callback function for a verbosity command.
Definition: couchbase.h:2337
const char * username
Username for bucket.
Definition: couchbase.h:254
lcb_VALUEFLAGS
Flags which can be returned int the the lcb_GETRESPv0::datatype field.
Definition: couchbase.h:828
lcb_error_t lcb_cntl_string(lcb_t instance, const char *key, const char *value)
Alternate way to set configuration settings by passing a string key and value.
lcb_bootstrap_callback lcb_set_bootstrap_callback(lcb_t instance, lcb_bootstrap_callback callback)
Set the callback for notification of success or failure of initial connection.
lcb_U16 replicate_to
how many nodes the key should be replicated to (excluding master)
Definition: couchbase.h:1880
Query the specific replica specified by the lcb_rget3_cmd_t::index field.
Definition: couchbase.h:1024
Response structure received for HTTP requests.
Definition: couchbase.h:2527
Wrapper structure for lcb_ARITHCMDv0.
Definition: couchbase.h:1391
This level traces all commands and generates a fair amount of output.
Definition: couchbase.h:2277
lcb_U8 cap_max
If replication/persistence requirements are excessive, cap to the maximum available.
Definition: couchbase.h:1892
lcb_time_t ttp
average time to persist on this server
Definition: couchbase.h:1546
Wrapper structure for lcb_make_http_request.
Definition: couchbase.h:2505
lcb_U32 flags
Server side flags stored with the item.
Definition: couchbase.h:841
const char *const * headers
List of headers.
Definition: couchbase.h:2531
This is the most verbose level and generates a lot of output on the server.
Definition: couchbase.h:2269
Value is raw bytes.
Definition: couchbase.h:829
lcb_error_t lcb_server_versions(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_server_version_cmd_t *const *commands)
Request server versions.
lcb_error_t lcb_make_http_request(lcb_t instance, const void *command_cookie, lcb_http_type_t type, const lcb_http_cmd_t *cmd, lcb_http_request_t *request)
Execute HTTP request matching given path and yield JSON result object.
Inner response structure for a get operation.
Definition: couchbase.h:836
lcb_error_t lcb_remove(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_remove_cmd_t *const *commands)
Remove a key from the cluster.
int create
If the item does not exist on the server, set this to true to force the creation of the item...
Definition: couchbase.h:1366
const void * bytes
Statistic value.
Definition: couchbase.h:2108
lcb_error_t lcb_destroy_io_ops(lcb_io_opt_t op)
Destroy the plugin handle created by lcb_create_io_ops()
const char * content_type
The Content-Type header for request.
Definition: couchbase.h:2480
Only return a node which is connected, or a node which is known to be up.
Definition: couchbase.h:2715
Wrapper structure for lcb_create()
Definition: couchbase.h:263
lcb_type_t
Handle types.
Definition: couchbase.h:230
lcb_error_t
Error codes returned by the library.
Definition: error.h:425
Command structure for arithmetic operations This is contained within the lcb_arithmetic_cmd_t structu...
Definition: couchbase.h:1353
lcb_storage_t operation
Mandatory.
Definition: couchbase.h:1239
void lcb_cancel_http_request(lcb_t instance, lcb_http_request_t request)
Cancel ongoing HTTP request.
wrapper structure for lcb_get_replica()
Definition: couchbase.h:1043
lcb_error_t lcb_set_verbosity(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_verbosity_cmd_t *const *commands)
Set the loglevel on the servers.
lcb_error_t lcb_wait(lcb_t instance)
Wait for the execution of all batched requests.
lcb_error_t lcb_enable_timings(lcb_t instance)
Start recording timing metrics for the different operations.
const char * lcb_get_version(lcb_U32 *version)
Get the version of the library.
Unconditionally set the object in the cache.
Definition: couchbase.h:1209
lcb_time_t ttr
average time to replicate on this server
Definition: couchbase.h:1547
lcb_error_t lcb_store(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_store_cmd_t *const *commands)
Store an item in the cluster.
lcb_get() Command Wrapper Structure
Definition: couchbase.h:815
void(* lcb_stat_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp)
The callback function for a stat request.
Definition: couchbase.h:2128
lcb_error_t lcb_create(lcb_t *instance, const struct lcb_create_st *options)
Create an instance of lcb.
void(* lcb_durability_callback)(lcb_t instance, const void *cookie, lcb_error_t err, const lcb_durability_resp_t *res)
Callback for durability status.
Definition: couchbase.h:2051
Time is in seconds.
Definition: couchbase.h:3049
lcb_store() Command structure
Definition: couchbase.h:1221
void * cookie
Plugin-specific argument.
Definition: couchbase.h:644
Value is compressed as Snappy.
Definition: couchbase.h:831
LCB_INTERNAL_API void lcb_run_loop(lcb_t instance)
These two functions unconditionally start and stop the event loop.
Response structure for lcb_durability_poll()
Definition: couchbase.h:1905
This is the default level and only errors and warnings will be logged.
Definition: couchbase.h:2280
void(* lcb_store_callback)(lcb_t instance, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp)
The callback function for a storage request.
Definition: couchbase.h:1278
The item missing on the disk and the memory.
Definition: couchbase.h:1530
lcb_arithmetic_callback lcb_set_arithmetic_callback(lcb_t, lcb_arithmetic_callback)
Response structure for lcb_server_versions()
Definition: couchbase.h:2197
Wrapper structure for lcb_STATSRESPv0.
Definition: couchbase.h:2113
lcb_error_t lcb_disable_timings(lcb_t instance)
Stop recording (and release all resources from previous measurements) timing metrics.
lcb_observe() Command wrapper structure
Definition: couchbase.h:1511
Dump information about each packet.
Definition: couchbase.h:3239
lcb_error_t(* lcb_errmap_callback)(lcb_t instance, lcb_U16 bincode)
Callback for error mappings.
Definition: couchbase.h:3204
void lcb_set_cookie(lcb_t instance, const void *cookie)
Associate a cookie with an instance of lcb.
lcb_unlock() wrapper response structure
Definition: couchbase.h:1125
lcb_error_t lcb_get_replica(lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_get_replica_cmd_t *const *commands)
Get a number of replca values from the cache.
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: couchbase.h:867
lcb_DUMPFLAGS
Definition: couchbase.h:3235
lcb_S64 delta
This number will be added to the current value on the server; if this is negative then the current va...
Definition: couchbase.h:1380
lcb_http_complete_callback lcb_set_http_complete_callback(lcb_t, lcb_http_complete_callback)
Set the HTTP completion callback for HTTP request completion.
This level generates a lot of output.
Definition: couchbase.h:2273
const void * body
The POST body for HTTP request.
Definition: couchbase.h:2470
Append this object to the existing object.
Definition: couchbase.h:1211
Execute a request against the bucket.
Definition: couchbase.h:2432
void(* lcb_bootstrap_callback)(lcb_t instance, lcb_error_t err)
Bootstrap callback.
Definition: couchbase.h:471
lcb_S32 lcb_get_num_nodes(lcb_t instance)
Get the number of the nodes in the cluster.
lcb_SIZE nbytes
Length of value to store.
Definition: couchbase.h:1225
void(* lcb_destroy_callback)(const void *cookie)
Callback received when instance is about to be destroyed.
Definition: couchbase.h:579
lcb_cas_t cas
If present, the server will check that the item's current CAS matches the value specified here...
Definition: couchbase.h:1233
lcb_cas_t cas
CAS of the item on this server.
Definition: couchbase.h:1543
void lcb_breakout(lcb_t instance)
Forcefully break from the event loop.
The item found in the memory, but not yet on the disk.
Definition: couchbase.h:1526
Dump everything.
Definition: couchbase.h:3243
unsigned char nreplicated
how many nodes (excluding master) this item was replicated to
Definition: couchbase.h:1937
lcb_S32 lcb_get_num_replicas(lcb_t instance)
Get the number of the replicas in the cluster.
The item hit the disk.
Definition: couchbase.h:1528
Only sends a command to the master.
Definition: couchbase.h:1491
void(* lcb_arithmetic_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp)
The callback function for an arithmetic request.
Definition: couchbase.h:1423
lcb_error_t err
if this entry failed, this contains the reason, e.g.
Definition: couchbase.h:1916
lcb_cas_t cas
CAS representing current mutation state of the item.
Definition: couchbase.h:842
Get a view (CAPI) node.
Definition: couchbase.h:2713
Public I/O integration interface.
lcb_SIZE nbody
Length of the body.
Definition: couchbase.h:2471
lcb_U16 persist_to
how many nodes the key should be persisted to (including master)
Definition: couchbase.h:1877
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_time_t exptime
If this parameter is specified and lock is not set then the server will also update the object's expi...
Definition: couchbase.h:791
void lcb_destroy_async(lcb_t instance, const void *arg)
Asynchronously schedule the destruction of an instance.
lcb_http_type_t
The type of HTTP request to execute.
Definition: couchbase.h:2427
lcb_time_t exptime
Expiration for the item.
Definition: couchbase.h:1238
uncommitted
Definition: couchbase.h:654
unsigned char exists_master
Whether the key exists on the master.
Definition: couchbase.h:1931
Get an HTTP configuration (Rest API) node.
Definition: couchbase.h:2709
Structure for lcb_create().
Definition: couchbase.h:252
const char * passwd
Password for bucket.
Definition: couchbase.h:255
void lcb_dump(lcb_t instance, FILE *fp, lcb_U32 flags)
Write a textual dump to a file.
void lcb_mem_free(void *ptr)
Use this to free memory allocated with lcb_mem_alloc.
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_CONNECTED
Definition: couchbase.h:2724
lcb_unlock() Command structure
Definition: couchbase.h:1100