18 #ifndef LIBCOUCHBASE_COUCHBASE_H
19 #define LIBCOUCHBASE_COUCHBASE_H 1
36 typedef struct lcb_HTTP_HANDLE_ lcb_HTTP_HANDLE;
42 #include <libcouchbase/sysdefs.h>
43 #include <libcouchbase/assert.h>
44 #include <libcouchbase/visibility.h>
47 #include <libcouchbase/configuration.h>
50 #include <libcouchbase/tracing.h>
51 #include <libcouchbase/logger.h>
247 LCB_CONFIG_TRANSPORT_LIST_END = 0,
248 LCB_CONFIG_TRANSPORT_HTTP = 1,
249 LCB_CONFIG_TRANSPORT_CCCP,
250 LCB_CONFIG_TRANSPORT_MAX
251 } lcb_BOOTSTRAP_TRANSPORT;
259 typedef struct lcb_CREATEOPTS_ lcb_CREATEOPTS;
262 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_destroy(lcb_CREATEOPTS *options);
263 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_connstr(lcb_CREATEOPTS *options,
const char *connstr,
size_t connstr_len);
264 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_bucket(lcb_CREATEOPTS *options,
const char *bucket,
size_t bucket_len);
265 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_logger(lcb_CREATEOPTS *options,
const lcb_LOGGER *logger);
266 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_credentials(lcb_CREATEOPTS *options,
const char *username,
267 size_t username_len,
const char *password,
size_t password_len);
269 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_io(lcb_CREATEOPTS *options,
struct lcb_io_opt_st *io);
414 } lcb_MUTATION_TOKEN;
416 LIBCOUCHBASE_API
int lcb_mutation_token_is_valid(
const lcb_MUTATION_TOKEN *token);
483 LCB_CALLBACK_STOREDUR,
485 LCB_CALLBACK_SDMUTATE,
501 #define LCB_CALLBACK_VIEWQUERY -1
504 #define LCB_CALLBACK_QUERY -2
507 #define LCB_CALLBACK_IXMGMT -3
510 #define LCB_CALLBACK_ANALYTICS -4
513 #define LCB_CALLBACK_SEARCH -5
515 #define LCB_CALLBACK_OPEN -6
522 LCB_DURABILITYLEVEL_NONE = 0x00,
540 typedef struct lcb_CMDBASE_ lcb_CMDBASE;
541 typedef struct lcb_RESPBASE_ lcb_RESPBASE;
687 LIBCOUCHBASE_API
lcb_STATUS lcb_respget_error_context(
const lcb_RESPGET *resp,
const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
692 LIBCOUCHBASE_API
lcb_STATUS lcb_respget_key(
const lcb_RESPGET *resp,
const char **key,
size_t *key_len);
693 LIBCOUCHBASE_API
lcb_STATUS lcb_respget_value(
const lcb_RESPGET *resp,
const char **value,
size_t *value_len);
695 typedef struct lcb_CMDGET_ lcb_CMDGET;
697 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_create(lcb_CMDGET **cmd);
698 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_destroy(lcb_CMDGET *cmd);
699 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_parent_span(lcb_CMDGET *cmd, lcbtrace_SPAN *span);
700 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_collection(lcb_CMDGET *cmd,
const char *scope,
size_t scope_len,
701 const char *collection,
size_t collection_len);
702 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_key(lcb_CMDGET *cmd,
const char *key,
size_t key_len);
703 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_expiry(lcb_CMDGET *cmd, uint32_t expiration);
704 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_locktime(lcb_CMDGET *cmd, uint32_t duration);
705 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_timeout(lcb_CMDGET *cmd, uint32_t timeout);
776 LCB_REPLICA_MODE_ANY = 0x00,
777 LCB_REPLICA_MODE_ALL = 0x01,
778 LCB_REPLICA_MODE_IDX0 = 0x02,
779 LCB_REPLICA_MODE_IDX1 = 0x03,
780 LCB_REPLICA_MODE_IDX2 = 0x04,
781 LCB_REPLICA_MODE__MAX
784 typedef struct lcb_RESPGETREPLICA_ lcb_RESPGETREPLICA;
786 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_status(
const lcb_RESPGETREPLICA *resp);
787 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_error_context(
const lcb_RESPGETREPLICA *resp,
788 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
789 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_cookie(
const lcb_RESPGETREPLICA *resp,
void **cookie);
790 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_cas(
const lcb_RESPGETREPLICA *resp, uint64_t *cas);
791 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_datatype(
const lcb_RESPGETREPLICA *resp, uint8_t *datatype);
792 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_flags(
const lcb_RESPGETREPLICA *resp, uint32_t *flags);
793 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_key(
const lcb_RESPGETREPLICA *resp,
const char **key,
size_t *key_len);
794 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_value(
const lcb_RESPGETREPLICA *resp,
const char **value,
796 LIBCOUCHBASE_API
int lcb_respgetreplica_is_final(
const lcb_RESPGETREPLICA *resp);
798 typedef struct lcb_CMDGETREPLICA_ lcb_CMDGETREPLICA;
801 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_destroy(lcb_CMDGETREPLICA *cmd);
802 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_parent_span(lcb_CMDGETREPLICA *cmd, lcbtrace_SPAN *span);
803 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_collection(lcb_CMDGETREPLICA *cmd,
const char *scope,
size_t scope_len,
804 const char *collection,
size_t collection_len);
805 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_key(lcb_CMDGETREPLICA *cmd,
const char *key,
size_t key_len);
806 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_timeout(lcb_CMDGETREPLICA *cmd, uint32_t timeout);
807 LIBCOUCHBASE_API
lcb_STATUS lcb_getreplica(
lcb_INSTANCE *instance,
void *cookie,
const lcb_CMDGETREPLICA *cmd);
811 typedef struct lcb_RESPEXISTS_ lcb_RESPEXISTS;
813 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_status(
const lcb_RESPEXISTS *resp);
814 LIBCOUCHBASE_API
int lcb_respexists_is_found(
const lcb_RESPEXISTS *resp);
815 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_error_context(
const lcb_RESPEXISTS *resp,
816 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
817 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_cookie(
const lcb_RESPEXISTS *resp,
void **cookie);
818 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_cas(
const lcb_RESPEXISTS *resp, uint64_t *cas);
819 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_key(
const lcb_RESPEXISTS *resp,
const char **key,
size_t *key_len);
821 typedef struct lcb_CMDEXISTS_ lcb_CMDEXISTS;
823 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_create(lcb_CMDEXISTS **cmd);
824 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_destroy(lcb_CMDEXISTS *cmd);
825 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_parent_span(lcb_CMDEXISTS *cmd, lcbtrace_SPAN *span);
826 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_collection(lcb_CMDEXISTS *cmd,
const char *scope,
size_t scope_len,
827 const char *collection,
size_t collection_len);
828 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_key(lcb_CMDEXISTS *cmd,
const char *key,
size_t key_len);
829 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_timeout(lcb_CMDEXISTS *cmd, uint32_t timeout);
944 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
949 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_mutation_token(
const lcb_RESPSTORE *resp, lcb_MUTATION_TOKEN *token);
951 LIBCOUCHBASE_API
int lcb_respstore_observe_attached(
const lcb_RESPSTORE *resp);
953 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_master_exists(
const lcb_RESPSTORE *resp,
int *master_exists);
954 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_master_persisted(
const lcb_RESPSTORE *resp,
int *master_persisted);
955 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_responses(
const lcb_RESPSTORE *resp, uint16_t *num_responses);
956 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_persisted(
const lcb_RESPSTORE *resp, uint16_t *num_persisted);
957 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_replicated(
const lcb_RESPSTORE *resp, uint16_t *num_replicated);
959 typedef struct lcb_CMDSTORE_ lcb_CMDSTORE;
962 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_destroy(lcb_CMDSTORE *cmd);
963 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_parent_span(lcb_CMDSTORE *cmd, lcbtrace_SPAN *span);
964 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_collection(lcb_CMDSTORE *cmd,
const char *scope,
size_t scope_len,
965 const char *collection,
size_t collection_len);
966 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_key(lcb_CMDSTORE *cmd,
const char *key,
size_t key_len);
967 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_value(lcb_CMDSTORE *cmd,
const char *value,
size_t value_len);
968 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_value_iov(lcb_CMDSTORE *cmd,
const lcb_IOV *value,
size_t value_len);
969 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_expiry(lcb_CMDSTORE *cmd, uint32_t expiration);
970 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_cas(lcb_CMDSTORE *cmd, uint64_t cas);
971 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_flags(lcb_CMDSTORE *cmd, uint32_t flags);
972 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_datatype(lcb_CMDSTORE *cmd, uint8_t datatype);
974 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_durability_observe(lcb_CMDSTORE *cmd,
int persist_to,
int replicate_to);
975 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_timeout(lcb_CMDSTORE *cmd, uint32_t timeout);
1064 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1070 typedef struct lcb_CMDREMOVE_ lcb_CMDREMOVE;
1072 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_create(lcb_CMDREMOVE **cmd);
1073 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_destroy(lcb_CMDREMOVE *cmd);
1074 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_parent_span(lcb_CMDREMOVE *cmd, lcbtrace_SPAN *span);
1075 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_collection(lcb_CMDREMOVE *cmd,
const char *scope,
size_t scope_len,
1076 const char *collection,
size_t collection_len);
1077 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_key(lcb_CMDREMOVE *cmd,
const char *key,
size_t key_len);
1078 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_cas(lcb_CMDREMOVE *cmd, uint64_t cas);
1080 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_timeout(lcb_CMDREMOVE *cmd, uint32_t timeout);
1148 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1155 typedef struct lcb_CMDCOUNTER_ lcb_CMDCOUNTER;
1157 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_create(lcb_CMDCOUNTER **cmd);
1158 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_destroy(lcb_CMDCOUNTER *cmd);
1159 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_parent_span(lcb_CMDCOUNTER *cmd, lcbtrace_SPAN *span);
1160 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_collection(lcb_CMDCOUNTER *cmd,
const char *scope,
size_t scope_len,
1161 const char *collection,
size_t collection_len);
1162 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_key(lcb_CMDCOUNTER *cmd,
const char *key,
size_t key_len);
1163 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_expiry(lcb_CMDCOUNTER *cmd, uint32_t expiration);
1164 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_delta(lcb_CMDCOUNTER *cmd, int64_t number);
1165 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_initial(lcb_CMDCOUNTER *cmd, uint64_t number);
1167 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_cas(lcb_CMDCOUNTER *cmd, uint64_t cas);
1168 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_timeout(lcb_CMDCOUNTER *cmd, uint32_t timeout);
1231 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1236 typedef struct lcb_CMDUNLOCK_ lcb_CMDUNLOCK;
1238 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_create(lcb_CMDUNLOCK **cmd);
1239 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_destroy(lcb_CMDUNLOCK *cmd);
1240 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_parent_span(lcb_CMDUNLOCK *cmd, lcbtrace_SPAN *span);
1241 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_collection(lcb_CMDUNLOCK *cmd,
const char *scope,
size_t scope_len,
1242 const char *collection,
size_t collection_len);
1243 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_key(lcb_CMDUNLOCK *cmd,
const char *key,
size_t key_len);
1244 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_cas(lcb_CMDUNLOCK *cmd, uint64_t cas);
1245 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_timeout(lcb_CMDUNLOCK *cmd, uint32_t timeout);
1296 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1300 LIBCOUCHBASE_API
lcb_STATUS lcb_resptouch_mutation_token(
const lcb_RESPTOUCH *resp, lcb_MUTATION_TOKEN *token);
1302 typedef struct lcb_CMDTOUCH_ lcb_CMDTOUCH;
1304 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_create(lcb_CMDTOUCH **cmd);
1305 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_destroy(lcb_CMDTOUCH *cmd);
1306 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_parent_span(lcb_CMDTOUCH *cmd, lcbtrace_SPAN *span);
1307 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_collection(lcb_CMDTOUCH *cmd,
const char *scope,
size_t scope_len,
1308 const char *collection,
size_t collection_len);
1309 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_key(lcb_CMDTOUCH *cmd,
const char *key,
size_t key_len);
1310 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_expiry(lcb_CMDTOUCH *cmd, uint32_t expiration);
1312 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_timeout(lcb_CMDTOUCH *cmd, uint32_t timeout);
1333 LCB_PING_STATUS_OK = 0,
1334 LCB_PING_STATUS_TIMEOUT,
1335 LCB_PING_STATUS_ERROR,
1336 LCB_PING_STATUS_INVALID,
1337 LCB_PING_STATUS__MAX
1346 LCB_PING_SERVICE_KV = 0,
1347 LCB_PING_SERVICE_VIEWS,
1348 LCB_PING_SERVICE_QUERY,
1349 LCB_PING_SERVICE_SEARCH,
1350 LCB_PING_SERVICE_ANALYTICS,
1351 LCB_PING_SERVICE__MAX
1354 typedef struct lcb_RESPPING_ lcb_RESPPING;
1356 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_status(
const lcb_RESPPING *resp);
1357 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_cookie(
const lcb_RESPPING *resp,
void **cookie);
1358 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_value(
const lcb_RESPPING *resp,
const char **json,
size_t *json_len);
1359 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_report_id(
const lcb_RESPPING *resp,
const char **report_id,
1360 size_t *report_id_len);
1361 LIBCOUCHBASE_API
size_t lcb_respping_result_size(
const lcb_RESPPING *resp);
1362 LIBCOUCHBASE_API
lcb_PING_STATUS lcb_respping_result_status(
const lcb_RESPPING *resp,
size_t index);
1363 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_id(
const lcb_RESPPING *resp,
size_t index,
const char **endpoint_id,
1364 size_t *endpoint_id_len);
1366 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_remote(
const lcb_RESPPING *resp,
size_t index,
const char **address,
1367 size_t *address_len);
1368 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_local(
const lcb_RESPPING *resp,
size_t index,
const char **address,
1369 size_t *address_len);
1370 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_latency(
const lcb_RESPPING *resp,
size_t index, uint64_t *latency);
1372 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_namespace(
const lcb_RESPPING *resp,
size_t index,
const char **name,
1375 LCB_DEPRECATED2(LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_scope(
const lcb_RESPPING *resp,
size_t index,
1376 const char **name,
size_t *name_len),
1377 "Use lcb_respping_result_namespace");
1379 typedef struct lcb_CMDPING_ lcb_CMDPING;
1381 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_create(lcb_CMDPING **cmd);
1382 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_destroy(lcb_CMDPING *cmd);
1383 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_parent_span(lcb_CMDPING *cmd, lcbtrace_SPAN *span);
1384 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_report_id(lcb_CMDPING *cmd,
const char *report_id,
size_t report_id_len);
1385 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_all(lcb_CMDPING *cmd);
1386 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_kv(lcb_CMDPING *cmd,
int enable);
1387 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_query(lcb_CMDPING *cmd,
int enable);
1388 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_views(lcb_CMDPING *cmd,
int enable);
1389 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_search(lcb_CMDPING *cmd,
int enable);
1390 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_analytics(lcb_CMDPING *cmd,
int enable);
1391 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_no_metrics(lcb_CMDPING *cmd,
int enable);
1392 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_encode_json(lcb_CMDPING *cmd,
int enable,
int pretty,
int with_details);
1393 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_timeout(lcb_CMDPING *cmd, uint32_t timeout);
1396 typedef struct lcb_RESPDIAG_ lcb_RESPDIAG;
1398 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_status(
const lcb_RESPDIAG *resp);
1399 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_cookie(
const lcb_RESPDIAG *resp,
void **cookie);
1400 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_value(
const lcb_RESPDIAG *resp,
const char **json,
size_t *json_len);
1402 typedef struct lcb_CMDDIAG_ lcb_CMDDIAG;
1404 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_create(lcb_CMDDIAG **cmd);
1405 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_destroy(lcb_CMDDIAG *cmd);
1406 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_report_id(lcb_CMDDIAG *cmd,
const char *report_id,
size_t report_id_len);
1407 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_prettify(lcb_CMDDIAG *cmd,
int enable);
1501 LCB_HTTP_TYPE_EVENTING = 7,
1513 LCB_HTTP_METHOD_GET = 0,
1514 LCB_HTTP_METHOD_POST = 1,
1515 LCB_HTTP_METHOD_PUT = 2,
1516 LCB_HTTP_METHOD_DELETE = 3,
1517 LCB_HTTP_METHOD_MAX = 4
1594 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_path(
const lcb_RESPHTTP *resp,
const char **path,
size_t *path_len);
1595 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_body(
const lcb_RESPHTTP *resp,
const char **body,
size_t *body_len);
1597 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_error_context(
const lcb_RESPHTTP *resp,
const lcb_HTTP_ERROR_CONTEXT **ctx);
1599 LIBCOUCHBASE_API
int lcb_resphttp_is_final(
const lcb_RESPHTTP *resp);
1606 typedef struct lcb_CMDHTTP_ lcb_CMDHTTP;
1609 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_destroy(lcb_CMDHTTP *cmd);
1610 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_parent_span(lcb_CMDHTTP *cmd, lcbtrace_SPAN *span);
1612 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_path(lcb_CMDHTTP *cmd,
const char *path,
size_t path_len);
1613 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_content_type(lcb_CMDHTTP *cmd,
const char *content_type,
1614 size_t content_type_len);
1615 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_body(lcb_CMDHTTP *cmd,
const char *body,
size_t body_len);
1616 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_handle(lcb_CMDHTTP *cmd, lcb_HTTP_HANDLE **handle);
1617 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_username(lcb_CMDHTTP *cmd,
const char *username,
size_t username_len);
1618 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_password(lcb_CMDHTTP *cmd,
const char *password,
size_t password_len);
1619 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_host(lcb_CMDHTTP *cmd,
const char *host,
size_t host_len);
1620 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_streaming(lcb_CMDHTTP *cmd,
int streaming);
1621 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_skip_auth_header(lcb_CMDHTTP *cmd,
int skip_auth);
1622 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_timeout(lcb_CMDHTTP *cmd, uint32_t timeout);
2031 #define LCB_DATATYPE_JSON 0x01
2034 typedef enum { LCB_VALUE_RAW = 0x00, LCB_VALUE_F_JSON = 0x01, LCB_VALUE_F_SNAPPYCOMP = 0x02 }
lcb_VALUEFLAGS;
2270 #if !defined(LCB_VERSION_STRING) || defined(__LCB_DOXYGEN__)
2272 #define LCB_VERSION_STRING "unknown"
2275 #if !defined(LCB_VERSION) || defined(__LCB_DOXYGEN__)
2291 #define LCB_VERSION 0x000000
2294 #if !defined(LCB_VERSION_CHANGESET) || defined(__LCB_DOXYGEN__)
2296 #define LCB_VERSION_CHANGESET "0xdeadbeef"
2316 #define LCB_SUPPORTS_SSL 1
2318 #define LCB_SUPPORTS_SNAPPY 2
2320 #define LCB_SUPPORTS_TRACING 3
2358 typedef struct lcb_ANALYTICS_HANDLE_ lcb_ANALYTICS_HANDLE;
2359 typedef struct lcb_DEFERRED_HANDLE_ lcb_DEFERRED_HANDLE;
2389 const lcb_ANALYTICS_ERROR_CONTEXT **ctx);
2392 lcb_DEFERRED_HANDLE **handle);
2393 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_destroy(lcb_DEFERRED_HANDLE *handle);
2394 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_status(lcb_DEFERRED_HANDLE *handle,
const char **status,
2395 size_t *status_len);
2397 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_poll(
lcb_INSTANCE *instance,
void *cookie, lcb_DEFERRED_HANDLE *handle);
2399 typedef struct lcb_CMDANALYTICS_ lcb_CMDANALYTICS;
2401 typedef struct lcb_INGEST_OPTIONS_ lcb_INGEST_OPTIONS;
2403 LCB_INGEST_METHOD_NONE = 0,
2404 LCB_INGEST_METHOD_UPSERT,
2405 LCB_INGEST_METHOD_INSERT,
2406 LCB_INGEST_METHOD_REPLACE,
2407 LCB_INGEST_METHOD__MAX
2408 } lcb_INGEST_METHOD;
2424 typedef enum { LCB_INGEST_STATUS_OK = 0, LCB_INGEST_STATUS_IGNORE, LCB_INGEST_STATUS__MAX } lcb_INGEST_STATUS;
2426 typedef struct lcb_INGEST_PARAM_ lcb_INGEST_PARAM;
2428 typedef lcb_INGEST_STATUS (*lcb_INGEST_DATACONVERTER_CALLBACK)(
lcb_INSTANCE *instance, lcb_INGEST_PARAM *param);
2430 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_create(lcb_INGEST_OPTIONS **options);
2431 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_destroy(lcb_INGEST_OPTIONS *options);
2432 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_method(lcb_INGEST_OPTIONS *options, lcb_INGEST_METHOD method);
2433 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_expiry(lcb_INGEST_OPTIONS *options, uint32_t expiration);
2434 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_ignore_error(lcb_INGEST_OPTIONS *options,
int flag);
2435 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_data_converter(lcb_INGEST_OPTIONS *options,
2436 lcb_INGEST_DATACONVERTER_CALLBACK callback);
2438 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_cookie(lcb_INGEST_PARAM *param,
void **cookie);
2439 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_row(lcb_INGEST_PARAM *param,
const char **row,
2441 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_method(lcb_INGEST_PARAM *param, lcb_INGEST_METHOD *method);
2442 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_set_id(lcb_INGEST_PARAM *param,
const char *
id,
2443 size_t id_len,
void (*id_dtor)(
const char *));
2444 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_set_out(lcb_INGEST_PARAM *param,
const char *out,
2445 size_t out_len,
void (*out_dtor)(
const char *));
2447 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_create(lcb_CMDANALYTICS **cmd);
2448 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_destroy(lcb_CMDANALYTICS *cmd);
2449 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_reset(lcb_CMDANALYTICS *cmd);
2481 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_encoded_payload(lcb_CMDANALYTICS *cmd,
const char **query,
2483 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_payload(lcb_CMDANALYTICS *cmd,
const char *query,
size_t query_len);
2484 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_statement(lcb_CMDANALYTICS *cmd,
const char *statement,
2485 size_t statement_len);
2486 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_named_param(lcb_CMDANALYTICS *cmd,
const char *name,
size_t name_len,
2487 const char *value,
size_t value_len);
2488 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_positional_param(lcb_CMDANALYTICS *cmd,
const char *value,
2490 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_ingest_options(lcb_CMDANALYTICS *cmd, lcb_INGEST_OPTIONS *options);
2491 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_deferred(lcb_CMDANALYTICS *cmd,
int deferred);
2492 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_client_context_id(lcb_CMDANALYTICS *cmd,
const char *value,
2494 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_readonly(lcb_CMDANALYTICS *cmd,
int readonly);
2495 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_priority(lcb_CMDANALYTICS *cmd,
int priority);
2497 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_option(lcb_CMDANALYTICS *cmd,
const char *name,
size_t name_len,
2498 const char *value,
size_t value_len);
2518 size_t qualifier_len);
2527 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_timeout(lcb_CMDANALYTICS *cmd, uint32_t timeout);
2588 typedef struct lcb_SEARCH_HANDLE_ lcb_SEARCH_HANDLE;
2589 typedef struct lcb_RESPSEARCH_ lcb_RESPSEARCH;
2591 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_status(
const lcb_RESPSEARCH *resp);
2592 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_cookie(
const lcb_RESPSEARCH *resp,
void **cookie);
2593 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_row(
const lcb_RESPSEARCH *resp,
const char **row,
size_t *row_len);
2594 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_http_response(
const lcb_RESPSEARCH *resp,
const lcb_RESPHTTP **http);
2603 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_error_context(
const lcb_RESPSEARCH *resp,
2604 const lcb_SEARCH_ERROR_CONTEXT **ctx);
2605 LIBCOUCHBASE_API
int lcb_respsearch_is_final(
const lcb_RESPSEARCH *resp);
2607 typedef struct lcb_CMDSEARCH_ lcb_CMDSEARCH;
2608 typedef void (*lcb_SEARCH_CALLBACK)(
lcb_INSTANCE *, int,
const lcb_RESPSEARCH *);
2610 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_create(lcb_CMDSEARCH **cmd);
2611 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_destroy(lcb_CMDSEARCH *cmd);
2645 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_callback(lcb_CMDSEARCH *cmd, lcb_SEARCH_CALLBACK callback);
2646 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_payload(lcb_CMDSEARCH *cmd,
const char *payload,
size_t payload_len);
2654 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_timeout(lcb_CMDSEARCH *cmd, uint32_t timeout);
2772 LCB_QUERY_PROFILE_OFF = 0,
2773 LCB_QUERY_PROFILE_PHASES = 1,
2774 LCB_QUERY_PROFILE_TIMINGS = 2
2775 } lcb_QUERY_PROFILE;
2782 LIBCOUCHBASE_API
lcb_STATUS lcb_respquery_error_context(
const lcb_RESPQUERY *resp,
const lcb_QUERY_ERROR_CONTEXT **ctx);
2783 LIBCOUCHBASE_API
int lcb_respquery_is_final(
const lcb_RESPQUERY *resp);
2885 size_t qualifier_len);
2895 const char *value,
size_t value_len);
2906 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdquery_client_context_id(
lcb_CMDQUERY *cmd,
const char *value,
size_t value_len);
2987 size_t keyspace_len,
2988 const lcb_MUTATION_TOKEN *token);
3056 typedef struct lcb_RESPVIEW_ lcb_RESPVIEW;
3057 typedef struct lcb_CMDVIEW_ lcb_CMDVIEW;
3077 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_status(
const lcb_RESPVIEW *resp);
3078 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_cookie(
const lcb_RESPVIEW *resp,
void **cookie);
3079 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_key(
const lcb_RESPVIEW *resp,
const char **key,
size_t *key_len);
3080 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_doc_id(
const lcb_RESPVIEW *resp,
const char **doc_id,
size_t *doc_id_len);
3081 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_row(
const lcb_RESPVIEW *resp,
const char **row,
size_t *row_len);
3082 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_document(
const lcb_RESPVIEW *resp,
const lcb_RESPGET **doc);
3083 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_http_response(
const lcb_RESPVIEW *resp,
const lcb_RESPHTTP **http);
3085 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_error_context(
const lcb_RESPVIEW *resp,
const lcb_VIEW_ERROR_CONTEXT **ctx);
3086 LIBCOUCHBASE_API
int lcb_respview_is_final(
const lcb_RESPVIEW *resp);
3088 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_create(lcb_CMDVIEW **cmd);
3089 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_destroy(lcb_CMDVIEW *cmd);
3090 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_parent_span(lcb_CMDVIEW *cmd, lcbtrace_SPAN *span);
3092 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_design_document(lcb_CMDVIEW *cmd,
const char *ddoc,
size_t ddoc_len);
3093 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_view_name(lcb_CMDVIEW *cmd,
const char *view,
size_t view_len);
3094 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_option_string(lcb_CMDVIEW *cmd,
const char *optstr,
size_t optstr_len);
3095 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_post_data(lcb_CMDVIEW *cmd,
const char *data,
size_t data_len);
3096 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_include_docs(lcb_CMDVIEW *cmd,
int include_docs);
3097 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_max_concurrent_docs(lcb_CMDVIEW *cmd, uint32_t num);
3098 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_no_row_parse(lcb_CMDVIEW *cmd,
int flag);
3100 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_timeout(lcb_CMDVIEW *cmd, uint32_t timeout);
3116 typedef struct lcb_RESPSUBDOC_ lcb_RESPSUBDOC;
3118 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_status(
const lcb_RESPSUBDOC *resp);
3119 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_error_context(
const lcb_RESPSUBDOC *resp,
3120 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
3121 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_cookie(
const lcb_RESPSUBDOC *resp,
void **cookie);
3122 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_cas(
const lcb_RESPSUBDOC *resp, uint64_t *cas);
3123 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_key(
const lcb_RESPSUBDOC *resp,
const char **key,
size_t *key_len);
3124 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_mutation_token(
const lcb_RESPSUBDOC *resp, lcb_MUTATION_TOKEN *token);
3126 LIBCOUCHBASE_API
size_t lcb_respsubdoc_result_size(
const lcb_RESPSUBDOC *resp);
3127 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_result_status(
const lcb_RESPSUBDOC *resp,
size_t index);
3128 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_result_value(
const lcb_RESPSUBDOC *resp,
size_t index,
const char **value,
3135 LIBCOUCHBASE_API
int lcb_respsubdoc_is_deleted(
const lcb_RESPSUBDOC *resp);
3137 typedef struct lcb_SUBDOCSPECS_ lcb_SUBDOCSPECS;
3140 #define LCB_SUBDOCSPECS_F_MKINTERMEDIATES (1u << 16u)
3143 #define LCB_SUBDOCSPECS_F_XATTRPATH (1u << 18u)
3146 #define LCB_SUBDOCSPECS_F_XATTR_MACROVALUES (1u << 19u)
3149 #define LCB_SUBDOCSPECS_F_XATTR_DELETED_OK (1u << 20u)
3151 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_create(lcb_SUBDOCSPECS **operations,
size_t capacity);
3152 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_destroy(lcb_SUBDOCSPECS *operations);
3153 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_get(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3154 const char *path,
size_t path_len);
3155 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_exists(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3156 const char *path,
size_t path_len);
3157 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_replace(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3158 const char *path,
size_t path_len,
const char *value,
3160 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_dict_add(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3161 const char *path,
size_t path_len,
const char *value,
3163 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_dict_upsert(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3164 const char *path,
size_t path_len,
const char *value,
3166 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_first(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3167 const char *path,
size_t path_len,
const char *value,
3169 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_last(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3170 const char *path,
size_t path_len,
const char *value,
3172 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_unique(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3173 const char *path,
size_t path_len,
const char *value,
3175 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_insert(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3176 const char *path,
size_t path_len,
const char *value,
3178 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_counter(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3179 const char *path,
size_t path_len, int64_t delta);
3180 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_remove(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3181 const char *path,
size_t path_len);
3182 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_get_count(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3183 const char *path,
size_t path_len);
3185 typedef struct lcb_CMDSUBDOC_ lcb_CMDSUBDOC;
3187 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_create(lcb_CMDSUBDOC **cmd);
3188 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_destroy(lcb_CMDSUBDOC *cmd);
3189 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_parent_span(lcb_CMDSUBDOC *cmd, lcbtrace_SPAN *span);
3190 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_collection(lcb_CMDSUBDOC *cmd,
const char *scope,
size_t scope_len,
3191 const char *collection,
size_t collection_len);
3192 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_key(lcb_CMDSUBDOC *cmd,
const char *key,
size_t key_len);
3193 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_cas(lcb_CMDSUBDOC *cmd, uint64_t cas);
3194 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_specs(lcb_CMDSUBDOC *cmd,
const lcb_SUBDOCSPECS *operations);
3195 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_expiry(lcb_CMDSUBDOC *cmd, uint32_t expiration);
3198 LCB_SUBDOC_STORE_REPLACE = 0,
3199 LCB_SUBDOC_STORE_UPSERT,
3200 LCB_SUBDOC_STORE_INSERT
3201 } lcb_SUBDOC_STORE_SEMANTICS;
3202 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_store_semantics(lcb_CMDSUBDOC *cmd, lcb_SUBDOC_STORE_SEMANTICS mode);
3203 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_access_deleted(lcb_CMDSUBDOC *cmd,
int flag);
3210 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_timeout(lcb_CMDSUBDOC *cmd, uint32_t timeout);