ctdb-server: Remove duplicate logic
[samba4-gss.git] / source3 / rpc_server / mdssvc / mdssvc_es.h
blob19797fa24f34f58627487fba084d797d1773dbc2
1 /*
2 Unix SMB/CIFS implementation.
3 Main metadata server / Spotlight routines / HTTP/ES/JSON backend
5 Copyright (C) Ralph Boehme 2019
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _MDSSVC_ES_H_
22 #define _MDSSVC_ES_H_
24 #include <jansson.h>
27 * Some global state
29 struct mdssvc_es_ctx {
30 struct mdssvc_ctx *mdssvc_ctx;
31 struct cli_credentials *creds;
32 json_t *mappings;
36 * Per mdssvc RPC bind state
38 struct mds_es_ctx {
40 * Pointer to higher level mds_ctx
42 struct mds_ctx *mds_ctx;
45 * Pointer to our global context
47 struct mdssvc_es_ctx *mdssvc_es_ctx;
50 * The HTTP connection handle to the ES server
52 struct http_conn *http_conn;
55 * List of pending searches
57 struct sl_es_search *searches;
60 /* Per search request */
61 struct sl_es_search {
63 * List pointers
65 struct sl_es_search *prev, *next;
68 * Search is being executed. Only the list head can be pending.
70 bool pending;
73 * Shorthand to our tevent context
75 struct tevent_context *ev;
78 * Pointer to the RPC connection ctx the request is using
80 struct mds_es_ctx *mds_es_ctx;
83 * The upper mdssvc.c level query context
85 struct sl_query *slq;
88 * Maximum number of results we process and total number of
89 * results of a query.
91 size_t total;
92 size_t max;
95 * For paging results
97 size_t from;
98 size_t size;
101 * The translated Es query
103 char *es_query;
106 extern struct mdssvc_backend mdsscv_backend_es;
108 #endif /* _MDSSVC_ES_H_ */