Couchbase C Client  2.10.0
Asynchronous C Client for Couchbase
ixmgmt.h
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2016 Couchbase, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef LCB_IXMGMT_H
19 #define LCB_IXMGMT_H
20 
21 #include <libcouchbase/couchbase.h>
22 #include <libcouchbase/n1ql.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
33 typedef struct {
49  const char *rawjson;
50  size_t nrawjson;
51 
53  const char *name;
54  size_t nname;
55 
60  const char *keyspace;
61  size_t nkeyspace;
62 
64  const char *nspace;
65  size_t nnspace;
66 
68  const char *state;
69  size_t nstate;
70 
79  const char *fields;
80  size_t nfields;
81 
84  const char *cond;
85  size_t ncond;
86 
95  unsigned flags;
96 
102  unsigned ixtype;
104 
106 #define LCB_N1XSPEC_F_PRIMARY (1 << 16)
107 
113 #define LCB_N1XSPEC_F_DEFER (1 << 17)
114 
119 #define LCB_N1XSPEC_T_DEFAULT 0
120 #define LCB_N1XSPEC_T_GSI 1
121 #define LCB_N1XSPEC_T_VIEW 2
122 
123 struct lcb_RESPN1XMGMT_st;
124 
131 typedef void (*lcb_N1XMGMTCALLBACK)(lcb_t instance,
132  int cbtype, const struct lcb_RESPN1XMGMT_st *resp);
133 
138 typedef struct {
145  lcb_N1XSPEC spec;
146 
150  lcb_N1XMGMTCALLBACK callback;
158 typedef struct lcb_RESPN1XMGMT_st {
159  LCB_RESP_BASE
160 
165  const lcb_N1XSPEC *const *specs;
167  size_t nspecs;
170  const lcb_RESPN1QL *inner;
172 
179 LIBCOUCHBASE_API
181 lcb_n1x_list(lcb_t instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
182 
189 LIBCOUCHBASE_API
191 lcb_n1x_create(lcb_t instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
192 
197 LIBCOUCHBASE_API
199 lcb_n1x_drop(lcb_t instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
200 
210 LIBCOUCHBASE_API
212 lcb_n1x_startbuild(lcb_t instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
213 
219 typedef struct {
225  const lcb_N1XSPEC * const *specs;
227  size_t nspec;
228 
233  lcb_U32 timeout;
234 
239  lcb_U32 interval;
240 
247  lcb_N1XMGMTCALLBACK callback;
249 
256 LIBCOUCHBASE_API
258 lcb_n1x_watchbuild(lcb_t instance, const void *cookie, const lcb_CMDN1XWATCH *cmd);
259 
260 #ifdef __cplusplus
261 }
262 #endif /* __cplusplus */
263 #endif /* LCB_IXMGMT_H */
Response for a N1QL query.
Definition: n1ql.h:429
Main header file for Couchbase.
Definition: ixmgmt.h:140
Definition: ixmgmt.h:227
struct lcb_st * lcb_t
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:41
lcb_error_t
Error codes returned by the library.
Definition: error.h:580
Definition: ixmgmt.h:34
Definition: ixmgmt.h:161