Couchbase C Client  3.3.11
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-2020 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/utils.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;
103 } lcb_N1XSPEC;
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_INSTANCE *instance, int cbtype, const struct lcb_RESPN1XMGMT_st *resp);
132 
137 typedef struct {
145 
149  lcb_N1XMGMTCALLBACK callback;
151 
157 typedef struct lcb_RESPN1XMGMT_st {
158  lcb_STATUS rc;
159  void *cookie;
160  lcb_U16 rflags;
161 
166  const lcb_N1XSPEC *const *specs;
168  size_t nspecs;
169 
173 
180 LCB_DEPRECATED2(LIBCOUCHBASE_API lcb_STATUS lcb_n1x_list(lcb_INSTANCE *instance, const void *cookie,
181  const lcb_CMDN1XMGMT *cmd),
182  "lcb_http must be used directly");
183 
190 LCB_DEPRECATED2(LIBCOUCHBASE_API lcb_STATUS lcb_n1x_create(lcb_INSTANCE *instance, const void *cookie,
191  const lcb_CMDN1XMGMT *cmd),
192  "lcb_http must be used directly");
193 
198 LCB_DEPRECATED2(LIBCOUCHBASE_API lcb_STATUS lcb_n1x_drop(lcb_INSTANCE *instance, const void *cookie,
199  const lcb_CMDN1XMGMT *cmd),
200  "lcb_http must be used directly");
201 
211 LCB_DEPRECATED2(LIBCOUCHBASE_API lcb_STATUS lcb_n1x_startbuild(lcb_INSTANCE *instance, const void *cookie,
212  const lcb_CMDN1XMGMT *cmd),
213  "lcb_http must be used directly");
214 
220 typedef struct {
226  const lcb_N1XSPEC *const *specs;
228  size_t nspec;
229 
234  lcb_U32 timeout;
235 
240  lcb_U32 interval;
241 
248  lcb_N1XMGMTCALLBACK callback;
250 
257 LCB_DEPRECATED2(LIBCOUCHBASE_API lcb_STATUS lcb_n1x_watchbuild(lcb_INSTANCE *instance, const void *cookie,
258  const lcb_CMDN1XWATCH *cmd),
259  "lcb_http must be used directly");
260 
261 #ifdef __cplusplus
262 }
263 #endif /* __cplusplus */
264 #endif /* LCB_IXMGMT_H */
Main header file for Couchbase.
lcb_STATUS
Error codes returned by the library.
Definition: error.h:212
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:35
struct lcb_RESPQUERY_ lcb_RESPQUERY
Opaque query response structure.
Definition: couchbase.h:2838
Definition: ixmgmt.h:137
lcb_N1XSPEC spec
The index to operate on.
Definition: ixmgmt.h:144
lcb_N1XMGMTCALLBACK callback
Callback to be invoked when operation is complete.
Definition: ixmgmt.h:149
Definition: ixmgmt.h:220
size_t nspec
Number of specs.
Definition: ixmgmt.h:228
lcb_U32 timeout
Maximum amount of time to wait (microseconds).
Definition: ixmgmt.h:234
lcb_N1XMGMTCALLBACK callback
Callback to invoke once the indexes have been built or the timeout has been reached.
Definition: ixmgmt.h:248
lcb_U32 interval
How often to check status (microseconds).
Definition: ixmgmt.h:240
const lcb_N1XSPEC *const * specs
Input specs.
Definition: ixmgmt.h:226
Definition: ixmgmt.h:33
const char * rawjson
Raw JSON returned from server.
Definition: ixmgmt.h:49
const char * keyspace
Keyspace or "bucket" of the index.
Definition: ixmgmt.h:60
const char * state
Output parameter only.
Definition: ixmgmt.h:68
const char * fields
Actual index text.
Definition: ixmgmt.h:79
unsigned ixtype
Type of this index, Can be LCB_N1XSPEC_T_DEFAULT for the default server type, or an explicit LCB_N1XS...
Definition: ixmgmt.h:102
const char * nspace
'namespace'.
Definition: ixmgmt.h:64
unsigned flags
Modifiers for the index itself.
Definition: ixmgmt.h:95
const char * cond
Indexing condition.
Definition: ixmgmt.h:84
const char * name
Name of the index.
Definition: ixmgmt.h:53
Definition: ixmgmt.h:157
size_t nspecs
Number of specs.
Definition: ixmgmt.h:168
const lcb_RESPQUERY * inner
Inner N1QL response.
Definition: ixmgmt.h:171
const lcb_N1XSPEC *const * specs
A list of pointers to specs.
Definition: ixmgmt.h:166
Various utility functions.