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/metrics.h> 51 #include <libcouchbase/tracing.h> 52 #include <libcouchbase/logger.h> 248 LCB_CONFIG_TRANSPORT_LIST_END = 0,
249 LCB_CONFIG_TRANSPORT_HTTP = 1,
250 LCB_CONFIG_TRANSPORT_CCCP,
251 LCB_CONFIG_TRANSPORT_MAX
252 } lcb_BOOTSTRAP_TRANSPORT;
260 typedef struct lcb_CREATEOPTS_ lcb_CREATEOPTS;
263 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_destroy(lcb_CREATEOPTS *options);
264 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_connstr(lcb_CREATEOPTS *options,
const char *connstr,
size_t connstr_len);
265 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_bucket(lcb_CREATEOPTS *options,
const char *bucket,
size_t bucket_len);
266 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_logger(lcb_CREATEOPTS *options,
const lcb_LOGGER *logger);
267 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_credentials(lcb_CREATEOPTS *options,
const char *username,
268 size_t username_len,
const char *password,
size_t password_len);
270 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_io(lcb_CREATEOPTS *options,
struct lcb_io_opt_st *io);
271 LIBCOUCHBASE_API
lcb_STATUS lcb_createopts_meter(lcb_CREATEOPTS *options,
const lcbmetrics_METER *metrics);
417 } lcb_MUTATION_TOKEN;
419 LIBCOUCHBASE_API
int lcb_mutation_token_is_valid(
const lcb_MUTATION_TOKEN *token);
486 LCB_CALLBACK_STOREDUR,
488 LCB_CALLBACK_SDMUTATE,
504 #define LCB_CALLBACK_VIEWQUERY -1 507 #define LCB_CALLBACK_QUERY -2 510 #define LCB_CALLBACK_IXMGMT -3 513 #define LCB_CALLBACK_ANALYTICS -4 516 #define LCB_CALLBACK_SEARCH -5 518 #define LCB_CALLBACK_OPEN -6 525 LCB_DURABILITYLEVEL_NONE = 0x00,
543 typedef void lcb_CMDBASE;
544 typedef void lcb_RESPBASE;
690 LIBCOUCHBASE_API
lcb_STATUS lcb_respget_error_context(
const lcb_RESPGET *resp,
const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
696 LIBCOUCHBASE_API
lcb_STATUS lcb_respget_value(
const lcb_RESPGET *resp,
const char **value,
size_t *value_len);
698 typedef struct lcb_CMDGET_ lcb_CMDGET;
700 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_create(lcb_CMDGET **cmd);
701 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_destroy(lcb_CMDGET *cmd);
702 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_parent_span(lcb_CMDGET *cmd, lcbtrace_SPAN *span);
703 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_collection(lcb_CMDGET *cmd,
const char *scope,
size_t scope_len,
704 const char *collection,
size_t collection_len);
705 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_key(lcb_CMDGET *cmd,
const char *key,
size_t key_len);
706 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_expiry(lcb_CMDGET *cmd, uint32_t expiration);
707 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_locktime(lcb_CMDGET *cmd, uint32_t duration);
708 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdget_timeout(lcb_CMDGET *cmd, uint32_t timeout);
783 LCB_REPLICA_MODE_ANY = 0x00,
784 LCB_REPLICA_MODE_ALL = 0x01,
785 LCB_REPLICA_MODE_IDX0 = 0x02,
786 LCB_REPLICA_MODE_IDX1 = 0x03,
787 LCB_REPLICA_MODE_IDX2 = 0x04,
788 LCB_REPLICA_MODE__MAX
791 typedef struct lcb_RESPGETREPLICA_ lcb_RESPGETREPLICA;
793 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_status(
const lcb_RESPGETREPLICA *resp);
794 LIBCOUCHBASE_API
int lcb_respgetreplica_is_active(
const lcb_RESPGETREPLICA *resp);
795 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_error_context(
const lcb_RESPGETREPLICA *resp,
796 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
797 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_cookie(
const lcb_RESPGETREPLICA *resp,
void **cookie);
798 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_cas(
const lcb_RESPGETREPLICA *resp, uint64_t *cas);
799 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_datatype(
const lcb_RESPGETREPLICA *resp, uint8_t *datatype);
800 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_flags(
const lcb_RESPGETREPLICA *resp, uint32_t *flags);
801 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_key(
const lcb_RESPGETREPLICA *resp,
const char **key,
size_t *key_len);
802 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetreplica_value(
const lcb_RESPGETREPLICA *resp,
const char **value,
804 LIBCOUCHBASE_API
int lcb_respgetreplica_is_final(
const lcb_RESPGETREPLICA *resp);
806 typedef struct lcb_CMDGETREPLICA_ lcb_CMDGETREPLICA;
809 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_destroy(lcb_CMDGETREPLICA *cmd);
810 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_parent_span(lcb_CMDGETREPLICA *cmd, lcbtrace_SPAN *span);
811 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_collection(lcb_CMDGETREPLICA *cmd,
const char *scope,
size_t scope_len,
812 const char *collection,
size_t collection_len);
813 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_key(lcb_CMDGETREPLICA *cmd,
const char *key,
size_t key_len);
814 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetreplica_timeout(lcb_CMDGETREPLICA *cmd, uint32_t timeout);
819 LIBCOUCHBASE_API
lcb_STATUS lcb_getreplica(
lcb_INSTANCE *instance,
void *cookie,
const lcb_CMDGETREPLICA *cmd);
823 typedef struct lcb_RESPEXISTS_ lcb_RESPEXISTS;
825 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_status(
const lcb_RESPEXISTS *resp);
826 LIBCOUCHBASE_API
int lcb_respexists_is_found(
const lcb_RESPEXISTS *resp);
827 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_error_context(
const lcb_RESPEXISTS *resp,
828 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
829 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_cookie(
const lcb_RESPEXISTS *resp,
void **cookie);
830 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_cas(
const lcb_RESPEXISTS *resp, uint64_t *cas);
831 LIBCOUCHBASE_API
lcb_STATUS lcb_respexists_key(
const lcb_RESPEXISTS *resp,
const char **key,
size_t *key_len);
833 typedef struct lcb_CMDEXISTS_ lcb_CMDEXISTS;
835 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_create(lcb_CMDEXISTS **cmd);
836 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_destroy(lcb_CMDEXISTS *cmd);
837 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_parent_span(lcb_CMDEXISTS *cmd, lcbtrace_SPAN *span);
838 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_collection(lcb_CMDEXISTS *cmd,
const char *scope,
size_t scope_len,
839 const char *collection,
size_t collection_len);
840 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_key(lcb_CMDEXISTS *cmd,
const char *key,
size_t key_len);
841 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdexists_timeout(lcb_CMDEXISTS *cmd, uint32_t timeout);
960 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
965 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_mutation_token(
const lcb_RESPSTORE *resp, lcb_MUTATION_TOKEN *token);
967 LIBCOUCHBASE_API
int lcb_respstore_observe_attached(
const lcb_RESPSTORE *resp);
970 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_master_persisted(
const lcb_RESPSTORE *resp,
int *master_persisted);
971 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_responses(
const lcb_RESPSTORE *resp, uint16_t *num_responses);
972 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_persisted(
const lcb_RESPSTORE *resp, uint16_t *num_persisted);
973 LIBCOUCHBASE_API
lcb_STATUS lcb_respstore_observe_num_replicated(
const lcb_RESPSTORE *resp, uint16_t *num_replicated);
975 typedef struct lcb_CMDSTORE_ lcb_CMDSTORE;
978 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_destroy(lcb_CMDSTORE *cmd);
979 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_parent_span(lcb_CMDSTORE *cmd, lcbtrace_SPAN *span);
980 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_collection(lcb_CMDSTORE *cmd,
const char *scope,
size_t scope_len,
981 const char *collection,
size_t collection_len);
982 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_key(lcb_CMDSTORE *cmd,
const char *key,
size_t key_len);
983 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_value(lcb_CMDSTORE *cmd,
const char *value,
size_t value_len);
984 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_value_iov(lcb_CMDSTORE *cmd,
const lcb_IOV *value,
size_t value_len);
985 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_expiry(lcb_CMDSTORE *cmd, uint32_t expiration);
986 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_preserve_expiry(lcb_CMDSTORE *cmd,
int should_preserve);
987 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_cas(lcb_CMDSTORE *cmd, uint64_t cas);
988 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_flags(lcb_CMDSTORE *cmd, uint32_t flags);
989 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_datatype(lcb_CMDSTORE *cmd, uint8_t datatype);
991 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_durability_observe(lcb_CMDSTORE *cmd,
int persist_to,
int replicate_to);
992 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdstore_timeout(lcb_CMDSTORE *cmd, uint32_t timeout);
1085 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1091 typedef struct lcb_CMDREMOVE_ lcb_CMDREMOVE;
1093 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_create(lcb_CMDREMOVE **cmd);
1094 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_destroy(lcb_CMDREMOVE *cmd);
1095 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_parent_span(lcb_CMDREMOVE *cmd, lcbtrace_SPAN *span);
1096 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_collection(lcb_CMDREMOVE *cmd,
const char *scope,
size_t scope_len,
1097 const char *collection,
size_t collection_len);
1098 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_key(lcb_CMDREMOVE *cmd,
const char *key,
size_t key_len);
1099 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_cas(lcb_CMDREMOVE *cmd, uint64_t cas);
1101 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdremove_timeout(lcb_CMDREMOVE *cmd, uint32_t timeout);
1173 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1180 typedef struct lcb_CMDCOUNTER_ lcb_CMDCOUNTER;
1182 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_create(lcb_CMDCOUNTER **cmd);
1183 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_destroy(lcb_CMDCOUNTER *cmd);
1184 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_parent_span(lcb_CMDCOUNTER *cmd, lcbtrace_SPAN *span);
1185 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_collection(lcb_CMDCOUNTER *cmd,
const char *scope,
size_t scope_len,
1186 const char *collection,
size_t collection_len);
1187 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_key(lcb_CMDCOUNTER *cmd,
const char *key,
size_t key_len);
1188 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_expiry(lcb_CMDCOUNTER *cmd, uint32_t expiration);
1189 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_delta(lcb_CMDCOUNTER *cmd, int64_t number);
1190 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_initial(lcb_CMDCOUNTER *cmd, uint64_t number);
1192 LCB_DEPRECATED2(LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_cas(lcb_CMDCOUNTER *cmd, uint64_t cas),
1193 "CAS is not applicable to arithmetic operations");
1194 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdcounter_timeout(lcb_CMDCOUNTER *cmd, uint32_t timeout);
1199 LIBCOUCHBASE_API
lcb_STATUS lcb_counter(
lcb_INSTANCE *instance,
void *cookie,
const lcb_CMDCOUNTER *cmd);
1261 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1266 typedef struct lcb_CMDUNLOCK_ lcb_CMDUNLOCK;
1268 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_create(lcb_CMDUNLOCK **cmd);
1269 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_destroy(lcb_CMDUNLOCK *cmd);
1270 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_parent_span(lcb_CMDUNLOCK *cmd, lcbtrace_SPAN *span);
1271 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_collection(lcb_CMDUNLOCK *cmd,
const char *scope,
size_t scope_len,
1272 const char *collection,
size_t collection_len);
1273 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_key(lcb_CMDUNLOCK *cmd,
const char *key,
size_t key_len);
1274 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_cas(lcb_CMDUNLOCK *cmd, uint64_t cas);
1275 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdunlock_timeout(lcb_CMDUNLOCK *cmd, uint32_t timeout);
1330 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
1334 LIBCOUCHBASE_API
lcb_STATUS lcb_resptouch_mutation_token(
const lcb_RESPTOUCH *resp, lcb_MUTATION_TOKEN *token);
1336 typedef struct lcb_CMDTOUCH_ lcb_CMDTOUCH;
1338 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_create(lcb_CMDTOUCH **cmd);
1339 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_destroy(lcb_CMDTOUCH *cmd);
1340 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_parent_span(lcb_CMDTOUCH *cmd, lcbtrace_SPAN *span);
1341 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_collection(lcb_CMDTOUCH *cmd,
const char *scope,
size_t scope_len,
1342 const char *collection,
size_t collection_len);
1343 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_key(lcb_CMDTOUCH *cmd,
const char *key,
size_t key_len);
1344 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_expiry(lcb_CMDTOUCH *cmd, uint32_t expiration);
1346 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdtouch_timeout(lcb_CMDTOUCH *cmd, uint32_t timeout);
1371 LCB_PING_STATUS_OK = 0,
1372 LCB_PING_STATUS_TIMEOUT,
1373 LCB_PING_STATUS_ERROR,
1374 LCB_PING_STATUS_INVALID,
1375 LCB_PING_STATUS__MAX
1384 LCB_PING_SERVICE_KV = 0,
1385 LCB_PING_SERVICE_VIEWS,
1386 LCB_PING_SERVICE_QUERY,
1387 LCB_PING_SERVICE_SEARCH,
1388 LCB_PING_SERVICE_ANALYTICS,
1389 LCB_PING_SERVICE__MAX
1392 typedef struct lcb_RESPPING_ lcb_RESPPING;
1394 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_status(
const lcb_RESPPING *resp);
1395 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_cookie(
const lcb_RESPPING *resp,
void **cookie);
1396 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_value(
const lcb_RESPPING *resp,
const char **json,
size_t *json_len);
1397 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_report_id(
const lcb_RESPPING *resp,
const char **report_id,
1398 size_t *report_id_len);
1399 LIBCOUCHBASE_API
size_t lcb_respping_result_size(
const lcb_RESPPING *resp);
1400 LIBCOUCHBASE_API
lcb_PING_STATUS lcb_respping_result_status(
const lcb_RESPPING *resp,
size_t index);
1401 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_id(
const lcb_RESPPING *resp,
size_t index,
const char **endpoint_id,
1402 size_t *endpoint_id_len);
1404 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_remote(
const lcb_RESPPING *resp,
size_t index,
const char **address,
1405 size_t *address_len);
1406 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_local(
const lcb_RESPPING *resp,
size_t index,
const char **address,
1407 size_t *address_len);
1408 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_latency(
const lcb_RESPPING *resp,
size_t index, uint64_t *latency);
1410 LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_namespace(
const lcb_RESPPING *resp,
size_t index,
const char **name,
1413 LCB_DEPRECATED2(LIBCOUCHBASE_API
lcb_STATUS lcb_respping_result_scope(
const lcb_RESPPING *resp,
size_t index,
1414 const char **name,
size_t *name_len),
1415 "Use lcb_respping_result_namespace");
1417 typedef struct lcb_CMDPING_ lcb_CMDPING;
1419 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_create(lcb_CMDPING **cmd);
1420 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_destroy(lcb_CMDPING *cmd);
1421 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_parent_span(lcb_CMDPING *cmd, lcbtrace_SPAN *span);
1422 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_report_id(lcb_CMDPING *cmd,
const char *report_id,
size_t report_id_len);
1423 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_all(lcb_CMDPING *cmd);
1424 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_kv(lcb_CMDPING *cmd,
int enable);
1425 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_query(lcb_CMDPING *cmd,
int enable);
1426 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_views(lcb_CMDPING *cmd,
int enable);
1427 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_search(lcb_CMDPING *cmd,
int enable);
1428 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_analytics(lcb_CMDPING *cmd,
int enable);
1429 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_no_metrics(lcb_CMDPING *cmd,
int enable);
1430 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_encode_json(lcb_CMDPING *cmd,
int enable,
int pretty,
int with_details);
1431 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdping_timeout(lcb_CMDPING *cmd, uint32_t timeout);
1434 typedef struct lcb_RESPDIAG_ lcb_RESPDIAG;
1436 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_status(
const lcb_RESPDIAG *resp);
1437 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_cookie(
const lcb_RESPDIAG *resp,
void **cookie);
1438 LIBCOUCHBASE_API
lcb_STATUS lcb_respdiag_value(
const lcb_RESPDIAG *resp,
const char **json,
size_t *json_len);
1440 typedef struct lcb_CMDDIAG_ lcb_CMDDIAG;
1442 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_create(lcb_CMDDIAG **cmd);
1443 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_destroy(lcb_CMDDIAG *cmd);
1444 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_report_id(lcb_CMDDIAG *cmd,
const char *report_id,
size_t report_id_len);
1445 LIBCOUCHBASE_API
lcb_STATUS lcb_cmddiag_prettify(lcb_CMDDIAG *cmd,
int enable);
1539 LCB_HTTP_TYPE_EVENTING = 7,
1551 LCB_HTTP_METHOD_GET = 0,
1552 LCB_HTTP_METHOD_POST = 1,
1553 LCB_HTTP_METHOD_PUT = 2,
1554 LCB_HTTP_METHOD_DELETE = 3,
1555 LCB_HTTP_METHOD_MAX = 4
1632 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_path(
const lcb_RESPHTTP *resp,
const char **path,
size_t *path_len);
1633 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_body(
const lcb_RESPHTTP *resp,
const char **body,
size_t *body_len);
1635 LIBCOUCHBASE_API
lcb_STATUS lcb_resphttp_error_context(
const lcb_RESPHTTP *resp,
const lcb_HTTP_ERROR_CONTEXT **ctx);
1637 LIBCOUCHBASE_API
int lcb_resphttp_is_final(
const lcb_RESPHTTP *resp);
1644 typedef struct lcb_CMDHTTP_ lcb_CMDHTTP;
1647 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_destroy(lcb_CMDHTTP *cmd);
1648 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_parent_span(lcb_CMDHTTP *cmd, lcbtrace_SPAN *span);
1650 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_path(lcb_CMDHTTP *cmd,
const char *path,
size_t path_len);
1651 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_content_type(lcb_CMDHTTP *cmd,
const char *content_type,
1652 size_t content_type_len);
1653 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_body(lcb_CMDHTTP *cmd,
const char *body,
size_t body_len);
1654 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_handle(lcb_CMDHTTP *cmd, lcb_HTTP_HANDLE **handle);
1655 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_username(lcb_CMDHTTP *cmd,
const char *username,
size_t username_len);
1656 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_password(lcb_CMDHTTP *cmd,
const char *password,
size_t password_len);
1657 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_host(lcb_CMDHTTP *cmd,
const char *host,
size_t host_len);
1658 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_streaming(lcb_CMDHTTP *cmd,
int streaming);
1659 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_skip_auth_header(lcb_CMDHTTP *cmd,
int skip_auth);
1660 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdhttp_timeout(lcb_CMDHTTP *cmd, uint32_t timeout);
2069 #define LCB_DATATYPE_JSON 0x01 2072 typedef enum { LCB_VALUE_RAW = 0x00, LCB_VALUE_F_JSON = 0x01, LCB_VALUE_F_SNAPPYCOMP = 0x02 }
lcb_VALUEFLAGS;
2308 #if !defined(LCB_VERSION_STRING) || defined(__LCB_DOXYGEN__) 2310 #define LCB_VERSION_STRING "unknown" 2313 #if !defined(LCB_VERSION) || defined(__LCB_DOXYGEN__) 2329 #define LCB_VERSION 0x000000 2332 #if !defined(LCB_VERSION_CHANGESET) || defined(__LCB_DOXYGEN__) 2334 #define LCB_VERSION_CHANGESET "0xdeadbeef" 2351 LIBCOUCHBASE_API LCB_EXTERN_VAR
const lcb_U32
lcb_version_g;
2354 #define LCB_SUPPORTS_SSL 1 2356 #define LCB_SUPPORTS_SNAPPY 2 2358 #define LCB_SUPPORTS_TRACING 3 2396 typedef struct lcb_ANALYTICS_HANDLE_ lcb_ANALYTICS_HANDLE;
2397 typedef struct lcb_DEFERRED_HANDLE_ lcb_DEFERRED_HANDLE;
2427 const lcb_ANALYTICS_ERROR_CONTEXT **ctx);
2430 lcb_DEFERRED_HANDLE **handle);
2431 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_destroy(lcb_DEFERRED_HANDLE *handle);
2432 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_status(lcb_DEFERRED_HANDLE *handle,
const char **status,
2433 size_t *status_len);
2435 LIBCOUCHBASE_API
lcb_STATUS lcb_deferred_handle_poll(
lcb_INSTANCE *instance,
void *cookie, lcb_DEFERRED_HANDLE *handle);
2437 typedef struct lcb_CMDANALYTICS_ lcb_CMDANALYTICS;
2439 typedef struct lcb_INGEST_OPTIONS_ lcb_INGEST_OPTIONS;
2441 LCB_INGEST_METHOD_NONE = 0,
2442 LCB_INGEST_METHOD_UPSERT,
2443 LCB_INGEST_METHOD_INSERT,
2444 LCB_INGEST_METHOD_REPLACE,
2445 LCB_INGEST_METHOD__MAX
2446 } lcb_INGEST_METHOD;
2462 typedef enum { LCB_INGEST_STATUS_OK = 0, LCB_INGEST_STATUS_IGNORE, LCB_INGEST_STATUS__MAX } lcb_INGEST_STATUS;
2464 typedef struct lcb_INGEST_PARAM_ lcb_INGEST_PARAM;
2466 typedef lcb_INGEST_STATUS (*lcb_INGEST_DATACONVERTER_CALLBACK)(
lcb_INSTANCE *instance, lcb_INGEST_PARAM *param);
2468 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_create(lcb_INGEST_OPTIONS **options);
2469 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_destroy(lcb_INGEST_OPTIONS *options);
2470 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_method(lcb_INGEST_OPTIONS *options, lcb_INGEST_METHOD method);
2471 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_expiry(lcb_INGEST_OPTIONS *options, uint32_t expiration);
2472 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_ignore_error(lcb_INGEST_OPTIONS *options,
int flag);
2473 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_options_data_converter(lcb_INGEST_OPTIONS *options,
2474 lcb_INGEST_DATACONVERTER_CALLBACK callback);
2476 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_cookie(lcb_INGEST_PARAM *param,
void **cookie);
2477 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_row(lcb_INGEST_PARAM *param,
const char **row,
2479 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_method(lcb_INGEST_PARAM *param, lcb_INGEST_METHOD *method);
2480 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_set_id(lcb_INGEST_PARAM *param,
const char *
id,
2481 size_t id_len,
void (*id_dtor)(
const char *));
2482 LIBCOUCHBASE_API
lcb_STATUS lcb_ingest_dataconverter_param_set_out(lcb_INGEST_PARAM *param,
const char *out,
2483 size_t out_len,
void (*out_dtor)(
const char *));
2485 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_create(lcb_CMDANALYTICS **cmd);
2486 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_destroy(lcb_CMDANALYTICS *cmd);
2487 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_reset(lcb_CMDANALYTICS *cmd);
2519 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_encoded_payload(lcb_CMDANALYTICS *cmd,
const char **query,
2521 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_payload(lcb_CMDANALYTICS *cmd,
const char *query,
size_t query_len);
2522 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_statement(lcb_CMDANALYTICS *cmd,
const char *statement,
2523 size_t statement_len);
2524 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_named_param(lcb_CMDANALYTICS *cmd,
const char *name,
size_t name_len,
2525 const char *value,
size_t value_len);
2544 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_ingest_options(lcb_CMDANALYTICS *cmd, lcb_INGEST_OPTIONS *options);
2545 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_deferred(lcb_CMDANALYTICS *cmd,
int deferred);
2546 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_client_context_id(lcb_CMDANALYTICS *cmd,
const char *value,
2548 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_readonly(lcb_CMDANALYTICS *cmd,
int readonly);
2549 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_priority(lcb_CMDANALYTICS *cmd,
int priority);
2551 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_option(lcb_CMDANALYTICS *cmd,
const char *name,
size_t name_len,
2552 const char *value,
size_t value_len);
2572 size_t qualifier_len);
2581 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdanalytics_timeout(lcb_CMDANALYTICS *cmd, uint32_t timeout);
2646 typedef struct lcb_SEARCH_HANDLE_ lcb_SEARCH_HANDLE;
2647 typedef struct lcb_RESPSEARCH_ lcb_RESPSEARCH;
2649 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_status(
const lcb_RESPSEARCH *resp);
2650 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_cookie(
const lcb_RESPSEARCH *resp,
void **cookie);
2651 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_row(
const lcb_RESPSEARCH *resp,
const char **row,
size_t *row_len);
2652 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_http_response(
const lcb_RESPSEARCH *resp,
const lcb_RESPHTTP **http);
2661 LIBCOUCHBASE_API
lcb_STATUS lcb_respsearch_error_context(
const lcb_RESPSEARCH *resp,
2662 const lcb_SEARCH_ERROR_CONTEXT **ctx);
2663 LIBCOUCHBASE_API
int lcb_respsearch_is_final(
const lcb_RESPSEARCH *resp);
2665 typedef struct lcb_CMDSEARCH_ lcb_CMDSEARCH;
2666 typedef void (*lcb_SEARCH_CALLBACK)(
lcb_INSTANCE *, int,
const lcb_RESPSEARCH *);
2668 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_create(lcb_CMDSEARCH **cmd);
2669 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_destroy(lcb_CMDSEARCH *cmd);
2703 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_callback(lcb_CMDSEARCH *cmd, lcb_SEARCH_CALLBACK callback);
2704 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_payload(lcb_CMDSEARCH *cmd,
const char *payload,
size_t payload_len);
2712 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsearch_timeout(lcb_CMDSEARCH *cmd, uint32_t timeout);
2834 LCB_QUERY_PROFILE_OFF = 0,
2835 LCB_QUERY_PROFILE_PHASES = 1,
2836 LCB_QUERY_PROFILE_TIMINGS = 2
2837 } lcb_QUERY_PROFILE;
2844 LIBCOUCHBASE_API
lcb_STATUS lcb_respquery_error_context(
const lcb_RESPQUERY *resp,
const lcb_QUERY_ERROR_CONTEXT **ctx);
2845 LIBCOUCHBASE_API
int lcb_respquery_is_final(
const lcb_RESPQUERY *resp);
2947 size_t qualifier_len);
2957 const char *value,
size_t value_len);
2975 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdquery_client_context_id(
lcb_CMDQUERY *cmd,
const char *value,
size_t value_len);
3056 size_t keyspace_len,
3057 const lcb_MUTATION_TOKEN *token);
3131 typedef struct lcb_RESPVIEW_ lcb_RESPVIEW;
3132 typedef struct lcb_CMDVIEW_ lcb_CMDVIEW;
3152 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_status(
const lcb_RESPVIEW *resp);
3153 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_cookie(
const lcb_RESPVIEW *resp,
void **cookie);
3154 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_key(
const lcb_RESPVIEW *resp,
const char **key,
size_t *key_len);
3155 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_doc_id(
const lcb_RESPVIEW *resp,
const char **doc_id,
size_t *doc_id_len);
3156 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_row(
const lcb_RESPVIEW *resp,
const char **row,
size_t *row_len);
3157 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_document(
const lcb_RESPVIEW *resp,
const lcb_RESPGET **doc);
3158 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_http_response(
const lcb_RESPVIEW *resp,
const lcb_RESPHTTP **http);
3160 LIBCOUCHBASE_API
lcb_STATUS lcb_respview_error_context(
const lcb_RESPVIEW *resp,
const lcb_VIEW_ERROR_CONTEXT **ctx);
3161 LIBCOUCHBASE_API
int lcb_respview_is_final(
const lcb_RESPVIEW *resp);
3163 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_create(lcb_CMDVIEW **cmd);
3164 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_destroy(lcb_CMDVIEW *cmd);
3165 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_parent_span(lcb_CMDVIEW *cmd, lcbtrace_SPAN *span);
3167 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_design_document(lcb_CMDVIEW *cmd,
const char *ddoc,
size_t ddoc_len);
3168 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_view_name(lcb_CMDVIEW *cmd,
const char *view,
size_t view_len);
3169 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_option_string(lcb_CMDVIEW *cmd,
const char *optstr,
size_t optstr_len);
3170 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_post_data(lcb_CMDVIEW *cmd,
const char *data,
size_t data_len);
3171 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_include_docs(lcb_CMDVIEW *cmd,
int include_docs);
3172 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_max_concurrent_docs(lcb_CMDVIEW *cmd, uint32_t num);
3173 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_no_row_parse(lcb_CMDVIEW *cmd,
int flag);
3175 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdview_timeout(lcb_CMDVIEW *cmd, uint32_t timeout);
3191 typedef struct lcb_RESPSUBDOC_ lcb_RESPSUBDOC;
3193 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_status(
const lcb_RESPSUBDOC *resp);
3194 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_error_context(
const lcb_RESPSUBDOC *resp,
3195 const lcb_KEY_VALUE_ERROR_CONTEXT **ctx);
3196 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_cookie(
const lcb_RESPSUBDOC *resp,
void **cookie);
3197 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_cas(
const lcb_RESPSUBDOC *resp, uint64_t *cas);
3198 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_key(
const lcb_RESPSUBDOC *resp,
const char **key,
size_t *key_len);
3199 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_mutation_token(
const lcb_RESPSUBDOC *resp, lcb_MUTATION_TOKEN *token);
3201 LIBCOUCHBASE_API
size_t lcb_respsubdoc_result_size(
const lcb_RESPSUBDOC *resp);
3202 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_result_status(
const lcb_RESPSUBDOC *resp,
size_t index);
3203 LIBCOUCHBASE_API
lcb_STATUS lcb_respsubdoc_result_value(
const lcb_RESPSUBDOC *resp,
size_t index,
const char **value,
3210 LIBCOUCHBASE_API
int lcb_respsubdoc_is_deleted(
const lcb_RESPSUBDOC *resp);
3212 typedef struct lcb_SUBDOCSPECS_ lcb_SUBDOCSPECS;
3215 #define LCB_SUBDOCSPECS_F_MKINTERMEDIATES (1u << 16u) 3218 #define LCB_SUBDOCSPECS_F_XATTRPATH (1u << 18u) 3221 #define LCB_SUBDOCSPECS_F_XATTR_MACROVALUES (1u << 19u) 3224 #define LCB_SUBDOCSPECS_F_XATTR_DELETED_OK (1u << 20u) 3226 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_create(lcb_SUBDOCSPECS **operations,
size_t capacity);
3227 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_destroy(lcb_SUBDOCSPECS *operations);
3228 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_get(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3229 const char *path,
size_t path_len);
3230 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_exists(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3231 const char *path,
size_t path_len);
3232 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_replace(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3233 const char *path,
size_t path_len,
const char *value,
3235 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_dict_add(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3236 const char *path,
size_t path_len,
const char *value,
3238 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_dict_upsert(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3239 const char *path,
size_t path_len,
const char *value,
3241 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_first(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3242 const char *path,
size_t path_len,
const char *value,
3244 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_last(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3245 const char *path,
size_t path_len,
const char *value,
3247 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_add_unique(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3248 const char *path,
size_t path_len,
const char *value,
3250 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_array_insert(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3251 const char *path,
size_t path_len,
const char *value,
3253 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_counter(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3254 const char *path,
size_t path_len, int64_t delta);
3255 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_remove(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3256 const char *path,
size_t path_len);
3257 LIBCOUCHBASE_API
lcb_STATUS lcb_subdocspecs_get_count(lcb_SUBDOCSPECS *operations,
size_t index, uint32_t flags,
3258 const char *path,
size_t path_len);
3260 typedef struct lcb_CMDSUBDOC_ lcb_CMDSUBDOC;
3262 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_create(lcb_CMDSUBDOC **cmd);
3263 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_destroy(lcb_CMDSUBDOC *cmd);
3264 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_parent_span(lcb_CMDSUBDOC *cmd, lcbtrace_SPAN *span);
3265 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_collection(lcb_CMDSUBDOC *cmd,
const char *scope,
size_t scope_len,
3266 const char *collection,
size_t collection_len);
3267 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_key(lcb_CMDSUBDOC *cmd,
const char *key,
size_t key_len);
3268 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_cas(lcb_CMDSUBDOC *cmd, uint64_t cas);
3269 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_specs(lcb_CMDSUBDOC *cmd,
const lcb_SUBDOCSPECS *operations);
3270 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_expiry(lcb_CMDSUBDOC *cmd, uint32_t expiration);
3271 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_preserve_expiry(lcb_CMDSUBDOC *cmd,
int should_preserve);
3274 LCB_SUBDOC_STORE_REPLACE = 0,
3275 LCB_SUBDOC_STORE_UPSERT,
3276 LCB_SUBDOC_STORE_INSERT
3277 } lcb_SUBDOC_STORE_SEMANTICS;
3278 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_store_semantics(lcb_CMDSUBDOC *cmd, lcb_SUBDOC_STORE_SEMANTICS mode);
3279 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_access_deleted(lcb_CMDSUBDOC *cmd,
int flag);
3286 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdsubdoc_timeout(lcb_CMDSUBDOC *cmd, uint32_t timeout);
void(* lcb_ANALYTICS_CALLBACK)(lcb_INSTANCE *, int, const lcb_RESPANALYTICS *)
Callback to be invoked for each row.
Definition: couchbase.h:2459
lcb_STATUS lcb_cmdunlock_on_behalf_of(lcb_CMDUNLOCK *cmd, const char *data, size_t data_len)
int lcb_supports_feature(int n)
lcb_STATUS lcb_cntl_string(lcb_INSTANCE *instance, const char *key, const char *value)
Alternatively one may change configuration settings by passing a string key and value...
void lcb_destroy(lcb_INSTANCE *instance)
Destroy (and release all allocated resources) an instance of lcb.
lcb_STATUS lcb_cmdquery_named_param(lcb_CMDQUERY *cmd, const char *name, size_t name_len, const char *value, size_t value_len)
Sets a named argument for the query.
lcb_STATUS lcb_cmdquery_consistency(lcb_CMDQUERY *cmd, lcb_QUERY_CONSISTENCY mode)
Sets the consistency mode for the request.
struct lcb_RESPREMOVE_ lcb_RESPREMOVE
Spool a removal of an item.
Definition: couchbase.h:1096
lcb_open_callback lcb_set_open_callback(lcb_INSTANCE *instance, lcb_open_callback callback)
Callback to be called when bucket is opened.
lcb_http()
Definition: couchbase.h:487
Unknown or unspecified.
Definition: couchbase.h:241
lcb_store()
Definition: couchbase.h:476
lcb_PING_SERVICE
Type of the service.
Definition: couchbase.h:1407
struct lcb_RESPSTORE_ lcb_RESPSTORE
Schedule a single storage request
Definition: couchbase.h:969
lcb_STATUS lcb_cmdsubdoc_on_behalf_of(lcb_CMDSUBDOC *cmd, const char *data, size_t data_len)
void(* lcb_destroy_callback)(const void *cookie)
Callback received when instance is about to be destroyed.
Definition: couchbase.h:2067
struct lcb_RESPGET_ lcb_RESPGET
Command for retrieving a single item.
Definition: couchbase.h:695
lcb_STATUS lcb_diag(lcb_INSTANCE *instance, void *cookie, const lcb_CMDDIAG *cmd)
Returns diagnostics report about network connections.
lcb_STATUS lcb_cmdanalytics_on_behalf_of(lcb_CMDANALYTICS *cmd, const char *data, size_t data_len)
lcb_STATUS lcb_cntl_setu32(lcb_INSTANCE *instance, int cmd, lcb_U32 arg)
Convenience function to set a value as an lcb_U32
void lcb_set_cookie(lcb_INSTANCE *instance, const void *cookie)
Associate a cookie with an instance of lcb.
void lcb_destroy_async(lcb_INSTANCE *instance, const void *arg)
Asynchronously schedule the destruction of an instance.
void lcb_sched_flush(lcb_INSTANCE *instance)
Request commands to be flushed to the network
Data persisted and replicated.
Definition: couchbase.h:242
struct lcb_RESPCOUNTER_ lcb_RESPCOUNTER
Schedule single counter operation.
Definition: couchbase.h:1186
lcb_counter()
Definition: couchbase.h:477
lcb_BTYPE
Type of the bucket.
Definition: couchbase.h:240
structure indicating a buffer and its size
Definition: iops.h:78
LCB_EXTERN_VAR const lcb_U32 lcb_version_g
Global/extern variable containing the version of the library.
Definition: couchbase.h:2397
lcb_STATUS lcb_cmdquery_encoded_payload(lcb_CMDQUERY *cmd, const char **payload, size_t *payload_len)
Get the JSON-encoded query payload.
Credentials store for Couchbase.
lcb_STATUS
Error codes returned by the library.
Definition: error.h:210
Default callback invoked as a fallback.
Definition: couchbase.h:474
lcb_destroy_callback lcb_set_destroy_callback(lcb_INSTANCE *instance, lcb_destroy_callback)
Set the callback to be invoked when the instance is destroyed asynchronously.
Tracer interface.
Definition: tracing.h:73
void(* lcb_QUERY_CALLBACK)(lcb_INSTANCE *, int, const lcb_RESPQUERY *)
Callback to be invoked for each row.
Definition: couchbase.h:2863
const char * lcb_strcbtype(int cbtype)
Returns the type of the callback as a string.
For lcb_observe_seqno3()
Definition: couchbase.h:489
lcb_STATUS lcb_cmdsubdoc_create_as_deleted(lcb_CMDSUBDOC *cmd, int flag)
If new document created, the server will create it as a tombstone.
Like LCB_STORE_APPEND, but prepends the new value to the existing value.
Definition: couchbase.h:908
lcb_STATUS lcb_search(lcb_INSTANCE *instance, void *cookie, const lcb_CMDSEARCH *cmd)
Issue a full-text query.
Strong consistency.
Definition: couchbase.h:2506
lcb_STATUS lcb_wait(lcb_INSTANCE *instance, lcb_WAITFLAGS flags)
Wait for completion of scheduled operations.
The response was a result of a not-my-vbucket error.
Definition: couchbase.h:446
lcb_STATUS lcb_cmdquery_reset(lcb_CMDQUERY *cmd)
Reset the lcb_CMDQUERY structure so that it may be reused for a subsequent query. ...
Handle for administrative access.
Definition: couchbase.h:257
lcb_getmanifest()
Definition: couchbase.h:496
void lcb_sched_leave(lcb_INSTANCE *instance)
Leave the current scheduling context, scheduling the commands within the context to be flushed to th...
lcb_INSTANCE_TYPE
Handle types.
Definition: couchbase.h:255
lcb_STORE_OPERATION
Values for lcb_CMDSTORE::operation.
Definition: couchbase.h:875
lcb_STATUS lcb_respanalytics_handle(const lcb_RESPANALYTICS *resp, lcb_ANALYTICS_HANDLE **handle)
Get handle to analytics query.
struct lcb_CMDQUERY_ lcb_CMDQUERY
Opaque query command structure.
Definition: couchbase.h:2851
lcb_STATUS lcb_cmdquery_payload(lcb_CMDQUERY *cmd, const char *query, size_t query_len)
Sets the JSON-encodes query payload to be executed.
lcb_STATUS lcb_cmdquery_consistency_token_for_keyspace(lcb_CMDQUERY *cmd, const char *keyspace, size_t keyspace_len, const lcb_MUTATION_TOKEN *token)
Indicate that the query should synchronize its internal snapshot to reflect the changes indicated by ...
lcb_STATUS lcb_cmdquery_readonly(lcb_CMDQUERY *cmd, int readonly)
Marks query as read-only.
void lcb_breakout(lcb_INSTANCE *instance)
Forcefully break from the event loop.
lcb_VALUEFLAGS
Definition: couchbase.h:2113
lcb_bootstrap_callback lcb_set_bootstrap_callback(lcb_INSTANCE *instance, lcb_bootstrap_callback callback)
Set the callback for notification of success or failure of initial connection.
lcb_STATUS lcb_tick_nowait(lcb_INSTANCE *instance)
int lcb_cntl_exists(int ctl)
Determine if a specific control code exists.
lcb_endure3_ctxnew()
Definition: couchbase.h:486
lcb_STATUS lcb_connect(lcb_INSTANCE *instance)
Schedule the initial connection This function will schedule the initial connection for the handle...
lcb_STATUS lcb_search_cancel(lcb_INSTANCE *instance, lcb_SEARCH_HANDLE *handle)
Cancel a full-text query in progress.
lcb_STATUS lcb_cmdanalytics_parent_span(lcb_CMDANALYTICS *cmd, lcbtrace_SPAN *span)
Associate parent tracing span with the Analytics request.
Definition of all of the error codes used by libcouchbase.
lcb_STATUS lcb_analytics_cancel(lcb_INSTANCE *instance, lcb_ANALYTICS_HANDLE *handle)
Cancels an in-progress request.
Refresh the snapshot for each request.
Definition: couchbase.h:2877
void lcb_sched_enter(lcb_INSTANCE *instance)
Enter a scheduling context.
lcb_getcid()
Definition: couchbase.h:497
lcb_STATUS lcb_cmdanalytics_scope_name(lcb_CMDANALYTICS *cmd, const char *scope, size_t scope_len)
Associate scope name with the query.
void(* lcb_VIEW_CALLBACK)(lcb_INSTANCE *instance, int cbtype, const lcb_RESPVIEW *row)
Callback function invoked for each row returned from the view.
Definition: couchbase.h:3203
Search a fulltext index.
Definition: couchbase.h:1552
lcb_STATUS lcb_cmdquery_scope_name(lcb_CMDQUERY *cmd, const char *scope, size_t scope_len)
Associate scope name with the query.
lcb_STATUS lcb_analytics(lcb_INSTANCE *instance, void *cookie, const lcb_CMDANALYTICS *cmd)
Execute a Analytics query.
lcb_CALLBACK_TYPE
The type of response passed to the callback.
Definition: couchbase.h:473
lcb_STATUS lcb_cmdquery_positional_param(lcb_CMDQUERY *cmd, const char *value, size_t value_len)
lcb_server_verbosity()
Definition: couchbase.h:483
Special pseudo-type, for ping endpoints in various services.
Definition: couchbase.h:1562
lcb_STATUS lcb_cmdtouch_on_behalf_of(lcb_CMDTOUCH *cmd, const char *data, size_t data_len)
The response was artificially generated inside the client.
Definition: couchbase.h:443
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:35
lcb_STATUS lcb_cmdanalytics_handle(lcb_CMDANALYTICS *cmd, lcb_ANALYTICS_HANDLE **handle)
Get handle to analytics query.
struct lcb_RESPHTTP_ lcb_RESPHTTP
Definition: couchbase.h:1653
struct lcb_VIEW_HANDLE_ lcb_VIEW_HANDLE
Pointer for request instance.
Definition: couchbase.h:3190
lcb_STATUS lcb_get_bootstrap_status(lcb_INSTANCE *instance)
Gets the initial bootstrap status
lcb_ANALYTICS_CONSISTENCY
Definition: couchbase.h:2495
lcb_stats3()
Definition: couchbase.h:481
Will cause the operation to fail if the key already exists in the cluster.
Definition: couchbase.h:890
Execute an arbitrary request against a host and port.
Definition: couchbase.h:1546
lcb_STATUS lcb_cmdremove_on_behalf_of(lcb_CMDREMOVE *cmd, const char *data, size_t data_len)
Execute an N1QL Query.
Definition: couchbase.h:1549
<for lcb_storedur3()
Definition: couchbase.h:491
lcb_touch()
Definition: couchbase.h:478
The default storage mode.
Definition: couchbase.h:884
void(* lcb_bootstrap_callback)(lcb_INSTANCE *instance, lcb_STATUS err)
Bootstrap callback.
Definition: couchbase.h:357
struct lcb_RESPANALYTICS_ lcb_RESPANALYTICS
Response for a Analytics query.
Definition: couchbase.h:2451
Opaque pointer containing credentials for the library.
Will cause the operation to fail unless the key already exists in the cluster.
Definition: couchbase.h:896
Command codes for libcouchbase.
Rather than setting the contents of the entire document, take the value specified in lcb_CMDSTORE::va...
Definition: couchbase.h:903
lcb_STATUS lcb_cmdsearch_parent_span(lcb_CMDSEARCH *cmd, lcbtrace_SPAN *span)
Associate parent tracing span with the FTS request.
lcb_STATUS lcb_create(lcb_INSTANCE **instance, const lcb_CREATEOPTS *options)
Create an instance of lcb.
Execute a request against the bucket.
Definition: couchbase.h:1533
Data not persisted, but replicated.
Definition: couchbase.h:243
lcb_STATUS lcb_cmdquery_destroy(lcb_CMDQUERY *cmd)
Free the command structure.
Low level structures used by commands for buffers.
lcb_server_versions()
Definition: couchbase.h:482
lcb_STATUS lcb_open(lcb_INSTANCE *instance, const char *bucket, size_t bucket_len)
Opens bucket.
lcb_STATUS lcb_cmdget_on_behalf_of(lcb_CMDGET *cmd, const char *data, size_t data_len)
No consistency constraints.
Definition: couchbase.h:2867
lcb_STATUS lcb_cmdquery_option(lcb_CMDQUERY *cmd, const char *name, size_t name_len, const char *value, size_t value_len)
Set a query option.
const void * lcb_get_cookie(lcb_INSTANCE *instance)
Retrieve the cookie associated with this instance
Handle for data access (default)
Definition: couchbase.h:256
lcb_STATUS lcb_respsearch_handle(const lcb_RESPSEARCH *resp, lcb_SEARCH_HANDLE **handle)
Get search handle from search response.
lcb_STATUS lcb_cmdquery_pipeline_batch(lcb_CMDQUERY *cmd, int value)
Sets the number of items execution operators can batch for fetch from the KV.
struct lcb_RESPTOUCH_ lcb_RESPTOUCH
Spool a touch request.
Definition: couchbase.h:1347
lcb_STATUS lcb_cmdquery_flex_index(lcb_CMDQUERY *cmd, int value)
int lcb_is_waiting(lcb_INSTANCE *instance)
Check if instance is blocked in the event loop
lcb_diag()
Definition: couchbase.h:495
Data not persisted and not replicated.
Definition: couchbase.h:244
lcb_ping3()
Definition: couchbase.h:494
lcb_STATUS lcb_cmdquery_positional_params(lcb_CMDQUERY *cmd, const char *value, size_t value_len)
Sets the positional arguments for the query.
lcb_remove()
Definition: couchbase.h:479
lcb_STATUS lcb_cmdstore_on_behalf_of(lcb_CMDSTORE *cmd, const char *data, size_t data_len)
As majority, but additionally persisted to the active node.
Definition: couchbase.h:540
void lcb_refresh_config(lcb_INSTANCE *instance)
Force the library to refetch the cluster configuration
struct lcb_RESPQUERY_ lcb_RESPQUERY
Opaque query response structure.
Definition: couchbase.h:2846
lcb_STATUS lcb_cmdgetreplica_on_behalf_of(lcb_CMDGETREPLICA *cmd, const char *data, size_t data_len)
lcb_DURABILITY_LEVEL
Definition: couchbase.h:529
lcb_get()
Definition: couchbase.h:475
lcb_STATUS lcb_query_cancel(lcb_INSTANCE *instance, lcb_QUERY_HANDLE *handle)
Cancels an in-progress request.
lcb_STATUS lcb_cmdsearch_handle(lcb_CMDSEARCH *cmd, lcb_SEARCH_HANDLE **handle)
Obtain handle to search.
lcb_observe3_ctxnew()
Definition: couchbase.h:484
void lcb_set_auth(lcb_INSTANCE *instance, lcb_AUTHENTICATOR *auth)
Sets the authenticator object for the instance.
lcb_RESPFLAGS
Response flags.
Definition: couchbase.h:434
lcb_STATUS lcb_resphttp_headers(const lcb_RESPHTTP *resp, const char *const **headers)
List of key-value headers.
lcb_cbflush3()
Definition: couchbase.h:488
struct lcb_RESPUNLOCK_ lcb_RESPUNLOCK
Unlock a previously locked item using lcb_cmdunlock
Definition: couchbase.h:1276
const char * lcb_get_version(lcb_U32 *version)
Get the version of the library.
Behave like the old lcb_wait()
Definition: couchbase.h:1844
lcb_exists()
Definition: couchbase.h:498
Flag, only valid for subdoc responses, indicates that the response was processed using the single-ope...
Definition: couchbase.h:454
lcb_STATUS lcb_cmdanalytics_positional_params(lcb_CMDANALYTICS *cmd, const char *value, size_t value_len)
Sets the positional arguments for the query.
void(* lcb_RESPCALLBACK)(lcb_INSTANCE *instance, int cbtype, const lcb_RESPBASE *resp)
Callback invoked for responses.
Definition: couchbase.h:559
Mutation must be replicated to (i.e.
Definition: couchbase.h:536
lcb_STATUS lcb_cmdsearch_on_behalf_of(lcb_CMDSEARCH *cmd, const char *data, size_t data_len)
lcb_getreplica()
Definition: couchbase.h:485
lcb_noop3()
Definition: couchbase.h:493
Refresh the snapshot for each statement.
Definition: couchbase.h:2880
lcb_QUERY_CONSISTENCY
Definition: couchbase.h:2865
lcb_PING_STATUS
Status of the service
Definition: couchbase.h:1393
int lcb_is_redacting_logs(lcb_INSTANCE *instance)
Returns whether the library redacting logs for this connection instance.
lcb_STATUS lcb_cntl(lcb_INSTANCE *instance, int mode, int cmd, void *arg)
This function exposes an ioctl/fcntl-like interface to read and write various configuration propert...
lcb_RESPCALLBACK lcb_get_callback(lcb_INSTANCE *instance, int cbtype)
No more responses are to be received for this request.
Definition: couchbase.h:436
lcb_HTTP_TYPE
The type of HTTP request to execute.
Definition: couchbase.h:1528
void lcb_sched_fail(lcb_INSTANCE *instance)
Fail all commands in the current scheduling context.
This is implicitly set by lcb_cmdquery_consistency_token_for_keyspace.
Definition: couchbase.h:2874
No consistency constraints.
Definition: couchbase.h:2501
Do not check pending operations before running the event loop.
Definition: couchbase.h:1853
lcb_STATUS lcb_cmdanalytics_scope_qualifier(lcb_CMDANALYTICS *cmd, const char *qualifier, size_t qualifier_len)
lcb_STATUS lcb_cmdquery_scope_qualifier(lcb_CMDQUERY *cmd, const char *qualifier, size_t qualifier_len)
The response has extra error information as value (see SDK-RFC-28).
Definition: couchbase.h:457
The response has additional internal data.
Definition: couchbase.h:450
lcb_STATUS lcb_query(lcb_INSTANCE *instance, void *cookie, const lcb_CMDQUERY *cmd)
Execute a N1QL query.
lcb_WAITFLAGS
Flags for lcb_wait()
Definition: couchbase.h:1842
lcb_U32 lcb_cntl_getu32(lcb_INSTANCE *instance, int cmd)
Retrieve an lcb_U32 setting
lcb_STATUS lcb_http_cancel(lcb_INSTANCE *instance, lcb_HTTP_HANDLE *handle)
Cancel ongoing HTTP request
lcb_STATUS lcb_cmdcounter_on_behalf_of(lcb_CMDCOUNTER *cmd, const char *data, size_t data_len)
lcb_STATUS lcb_cmdquery_on_behalf_of(lcb_CMDQUERY *cmd, const char *data, size_t data_len)
lcb_RESPCALLBACK lcb_install_callback(lcb_INSTANCE *instance, int cbtype, lcb_RESPCALLBACK cb)
lcb_STATUS lcb_cmdquery_parent_span(lcb_CMDQUERY *cmd, lcbtrace_SPAN *span)
Associate parent tracing span with the N1QL request.
lcb_STATUS lcb_cmdanalytics_positional_param(lcb_CMDANALYTICS *cmd, const char *value, size_t value_len)
struct lcb_QUERY_HANDLE_ lcb_QUERY_HANDLE
Pointer for request instance.
Definition: couchbase.h:2855
Mutation must be persisted to (i.e.
Definition: couchbase.h:545
lcb_STATUS lcb_cmdquery_scan_cap(lcb_CMDQUERY *cmd, int value)
Sets maximum buffered channel size between the indexer client and the query service for index scans...
lcb_REPLICA_MODE
Spool a single get-with-replica request.
Definition: couchbase.h:792
Public I/O integration interface.
lcb_unlock()
Definition: couchbase.h:480
lcb_STATUS lcb_cmdquery_create(lcb_CMDQUERY **cmd)
Create a new lcb_CMDQUERY object.
Execute an Analytics Query.
Definition: couchbase.h:1555
Execute a management API request.
Definition: couchbase.h:1541
lcb_HTTP_METHOD
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:1575
lcb_STATUS lcb_cmdexists_on_behalf_of(lcb_CMDEXISTS *cmd, const char *data, size_t data_len)
lcb_STATUS lcb_cmdquery_statement(lcb_CMDQUERY *cmd, const char *statement, size_t statement_len)
Sets the actual statement to be executed.
lcb_STATUS lcb_cmdquery_pipeline_cap(lcb_CMDQUERY *cmd, int value)
Sets maximum number of items each execution operator can buffer between various operators.