Couchbase C Client  3.2.1
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;
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 {
144  lcb_N1XSPEC spec;
145 
149  lcb_N1XMGMTCALLBACK callback;
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;
171  const lcb_RESPQUERY *inner;
173 
180 LIBCOUCHBASE_API
181 lcb_STATUS lcb_n1x_list(lcb_INSTANCE *instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
182 
189 LIBCOUCHBASE_API
190 lcb_STATUS lcb_n1x_create(lcb_INSTANCE *instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
191 
196 LIBCOUCHBASE_API
197 lcb_STATUS lcb_n1x_drop(lcb_INSTANCE *instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
198 
208 LIBCOUCHBASE_API
209 lcb_STATUS lcb_n1x_startbuild(lcb_INSTANCE *instance, const void *cookie, const lcb_CMDN1XMGMT *cmd);
210 
216 typedef struct {
222  const lcb_N1XSPEC *const *specs;
224  size_t nspec;
225 
230  lcb_U32 timeout;
231 
236  lcb_U32 interval;
237 
244  lcb_N1XMGMTCALLBACK callback;
246 
253 LIBCOUCHBASE_API
254 lcb_STATUS lcb_n1x_watchbuild(lcb_INSTANCE *instance, const void *cookie, const lcb_CMDN1XWATCH *cmd);
255 
256 #ifdef __cplusplus
257 }
258 #endif /* __cplusplus */
259 #endif /* LCB_IXMGMT_H */
lcb_STATUS
Error codes returned by the library.
Definition: error.h:210
Main header file for Couchbase.
Definition: ixmgmt.h:139
Various utility functions
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:35
Definition: ixmgmt.h:224
struct lcb_RESPQUERY_ lcb_RESPQUERY
Opaque query response structure.
Definition: couchbase.h:2796
Definition: ixmgmt.h:34
Definition: ixmgmt.h:160