1 /* Generated by the protocol buffer compiler.  DO NOT EDIT! */
2 /* Generated from: remote.proto */
3 
4 #ifndef PROTOBUF_C_remote_2eproto__INCLUDED
5 #define PROTOBUF_C_remote_2eproto__INCLUDED
6 
7 #include <prometheus_remote_write/protobuf-c.h>
8 
9 PROTOBUF_C__BEGIN_DECLS
10 
11 #if PROTOBUF_C_VERSION_NUMBER < 1003000
12 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
13 #elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
14 # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
15 #endif
16 
17 #include "types.pb-c.h"
18 // #include "gogoproto/gogo.pb-c.h"
19 
20 typedef struct _Prometheus__WriteRequest Prometheus__WriteRequest;
21 typedef struct _Prometheus__ReadRequest Prometheus__ReadRequest;
22 typedef struct _Prometheus__ReadResponse Prometheus__ReadResponse;
23 typedef struct _Prometheus__Query Prometheus__Query;
24 typedef struct _Prometheus__QueryResult Prometheus__QueryResult;
25 typedef struct _Prometheus__ChunkedReadResponse Prometheus__ChunkedReadResponse;
26 
27 
28 /* --- enums --- */
29 
30 typedef enum _Prometheus__ReadRequest__ResponseType {
31   /*
32    * Server will return a single ReadResponse message with matched series that includes list of raw samples.
33    * It's recommended to use streamed response types instead.
34    * Response headers:
35    * Content-Type: "application/x-protobuf"
36    * Content-Encoding: "snappy"
37    */
38   PROMETHEUS__READ_REQUEST__RESPONSE_TYPE__SAMPLES = 0,
39   /*
40    * Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series.
41    * Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum.
42    * Response headers:
43    * Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse"
44    * Content-Encoding: ""
45    */
46   PROMETHEUS__READ_REQUEST__RESPONSE_TYPE__STREAMED_XOR_CHUNKS = 1
47     PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(PROMETHEUS__READ_REQUEST__RESPONSE_TYPE)
48 } Prometheus__ReadRequest__ResponseType;
49 
50 /* --- messages --- */
51 
52 struct  _Prometheus__WriteRequest
53 {
54   ProtobufCMessage base;
55   size_t n_timeseries;
56   Prometheus__TimeSeries **timeseries;
57   size_t n_metadata;
58   Prometheus__MetricMetadata **metadata;
59 };
60 #define PROMETHEUS__WRITE_REQUEST__INIT \
61  { PROTOBUF_C_MESSAGE_INIT (&prometheus__write_request__descriptor) \
62     , 0,NULL, 0,NULL }
63 
64 
65 /*
66  * ReadRequest represents a remote read request.
67  */
68 struct  _Prometheus__ReadRequest
69 {
70   ProtobufCMessage base;
71   size_t n_queries;
72   Prometheus__Query **queries;
73   /*
74    * accepted_response_types allows negotiating the content type of the response.
75    * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
76    * implemented by server, error is returned.
77    * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
78    */
79   size_t n_accepted_response_types;
80   Prometheus__ReadRequest__ResponseType *accepted_response_types;
81 };
82 #define PROMETHEUS__READ_REQUEST__INIT \
83  { PROTOBUF_C_MESSAGE_INIT (&prometheus__read_request__descriptor) \
84     , 0,NULL, 0,NULL }
85 
86 
87 /*
88  * ReadResponse is a response when response_type equals SAMPLES.
89  */
90 struct  _Prometheus__ReadResponse
91 {
92   ProtobufCMessage base;
93   /*
94    * In same order as the request's queries.
95    */
96   size_t n_results;
97   Prometheus__QueryResult **results;
98 };
99 #define PROMETHEUS__READ_RESPONSE__INIT \
100  { PROTOBUF_C_MESSAGE_INIT (&prometheus__read_response__descriptor) \
101     , 0,NULL }
102 
103 
104 struct  _Prometheus__Query
105 {
106   ProtobufCMessage base;
107   int64_t start_timestamp_ms;
108   int64_t end_timestamp_ms;
109   size_t n_matchers;
110   Prometheus__LabelMatcher **matchers;
111   Prometheus__ReadHints *hints;
112 };
113 #define PROMETHEUS__QUERY__INIT \
114  { PROTOBUF_C_MESSAGE_INIT (&prometheus__query__descriptor) \
115     , 0, 0, 0,NULL, NULL }
116 
117 
118 struct  _Prometheus__QueryResult
119 {
120   ProtobufCMessage base;
121   /*
122    * Samples within a time series must be ordered by time.
123    */
124   size_t n_timeseries;
125   Prometheus__TimeSeries **timeseries;
126 };
127 #define PROMETHEUS__QUERY_RESULT__INIT \
128  { PROTOBUF_C_MESSAGE_INIT (&prometheus__query_result__descriptor) \
129     , 0,NULL }
130 
131 
132 /*
133  * ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS.
134  * We strictly stream full series after series, optionally split by time. This means that a single frame can contain
135  * partition of the single series, but once a new series is started to be streamed it means that no more chunks will
136  * be sent for previous one. Series are returned sorted in the same way TSDB block are internally.
137  */
138 struct  _Prometheus__ChunkedReadResponse
139 {
140   ProtobufCMessage base;
141   size_t n_chunked_series;
142   Prometheus__ChunkedSeries **chunked_series;
143   /*
144    * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
145    */
146   int64_t query_index;
147 };
148 #define PROMETHEUS__CHUNKED_READ_RESPONSE__INIT \
149  { PROTOBUF_C_MESSAGE_INIT (&prometheus__chunked_read_response__descriptor) \
150     , 0,NULL, 0 }
151 
152 
153 /* Prometheus__WriteRequest methods */
154 void   prometheus__write_request__init
155                      (Prometheus__WriteRequest         *message);
156 size_t prometheus__write_request__get_packed_size
157                      (const Prometheus__WriteRequest   *message);
158 size_t prometheus__write_request__pack
159                      (const Prometheus__WriteRequest   *message,
160                       uint8_t             *out);
161 size_t prometheus__write_request__pack_to_buffer
162                      (const Prometheus__WriteRequest   *message,
163                       ProtobufCBuffer     *buffer);
164 Prometheus__WriteRequest *
165        prometheus__write_request__unpack
166                      (ProtobufCAllocator  *allocator,
167                       size_t               len,
168                       const uint8_t       *data);
169 void   prometheus__write_request__free_unpacked
170                      (Prometheus__WriteRequest *message,
171                       ProtobufCAllocator *allocator);
172 /* Prometheus__ReadRequest methods */
173 void   prometheus__read_request__init
174                      (Prometheus__ReadRequest         *message);
175 size_t prometheus__read_request__get_packed_size
176                      (const Prometheus__ReadRequest   *message);
177 size_t prometheus__read_request__pack
178                      (const Prometheus__ReadRequest   *message,
179                       uint8_t             *out);
180 size_t prometheus__read_request__pack_to_buffer
181                      (const Prometheus__ReadRequest   *message,
182                       ProtobufCBuffer     *buffer);
183 Prometheus__ReadRequest *
184        prometheus__read_request__unpack
185                      (ProtobufCAllocator  *allocator,
186                       size_t               len,
187                       const uint8_t       *data);
188 void   prometheus__read_request__free_unpacked
189                      (Prometheus__ReadRequest *message,
190                       ProtobufCAllocator *allocator);
191 /* Prometheus__ReadResponse methods */
192 void   prometheus__read_response__init
193                      (Prometheus__ReadResponse         *message);
194 size_t prometheus__read_response__get_packed_size
195                      (const Prometheus__ReadResponse   *message);
196 size_t prometheus__read_response__pack
197                      (const Prometheus__ReadResponse   *message,
198                       uint8_t             *out);
199 size_t prometheus__read_response__pack_to_buffer
200                      (const Prometheus__ReadResponse   *message,
201                       ProtobufCBuffer     *buffer);
202 Prometheus__ReadResponse *
203        prometheus__read_response__unpack
204                      (ProtobufCAllocator  *allocator,
205                       size_t               len,
206                       const uint8_t       *data);
207 void   prometheus__read_response__free_unpacked
208                      (Prometheus__ReadResponse *message,
209                       ProtobufCAllocator *allocator);
210 /* Prometheus__Query methods */
211 void   prometheus__query__init
212                      (Prometheus__Query         *message);
213 size_t prometheus__query__get_packed_size
214                      (const Prometheus__Query   *message);
215 size_t prometheus__query__pack
216                      (const Prometheus__Query   *message,
217                       uint8_t             *out);
218 size_t prometheus__query__pack_to_buffer
219                      (const Prometheus__Query   *message,
220                       ProtobufCBuffer     *buffer);
221 Prometheus__Query *
222        prometheus__query__unpack
223                      (ProtobufCAllocator  *allocator,
224                       size_t               len,
225                       const uint8_t       *data);
226 void   prometheus__query__free_unpacked
227                      (Prometheus__Query *message,
228                       ProtobufCAllocator *allocator);
229 /* Prometheus__QueryResult methods */
230 void   prometheus__query_result__init
231                      (Prometheus__QueryResult         *message);
232 size_t prometheus__query_result__get_packed_size
233                      (const Prometheus__QueryResult   *message);
234 size_t prometheus__query_result__pack
235                      (const Prometheus__QueryResult   *message,
236                       uint8_t             *out);
237 size_t prometheus__query_result__pack_to_buffer
238                      (const Prometheus__QueryResult   *message,
239                       ProtobufCBuffer     *buffer);
240 Prometheus__QueryResult *
241        prometheus__query_result__unpack
242                      (ProtobufCAllocator  *allocator,
243                       size_t               len,
244                       const uint8_t       *data);
245 void   prometheus__query_result__free_unpacked
246                      (Prometheus__QueryResult *message,
247                       ProtobufCAllocator *allocator);
248 /* Prometheus__ChunkedReadResponse methods */
249 void   prometheus__chunked_read_response__init
250                      (Prometheus__ChunkedReadResponse         *message);
251 size_t prometheus__chunked_read_response__get_packed_size
252                      (const Prometheus__ChunkedReadResponse   *message);
253 size_t prometheus__chunked_read_response__pack
254                      (const Prometheus__ChunkedReadResponse   *message,
255                       uint8_t             *out);
256 size_t prometheus__chunked_read_response__pack_to_buffer
257                      (const Prometheus__ChunkedReadResponse   *message,
258                       ProtobufCBuffer     *buffer);
259 Prometheus__ChunkedReadResponse *
260        prometheus__chunked_read_response__unpack
261                      (ProtobufCAllocator  *allocator,
262                       size_t               len,
263                       const uint8_t       *data);
264 void   prometheus__chunked_read_response__free_unpacked
265                      (Prometheus__ChunkedReadResponse *message,
266                       ProtobufCAllocator *allocator);
267 /* --- per-message closures --- */
268 
269 typedef void (*Prometheus__WriteRequest_Closure)
270                  (const Prometheus__WriteRequest *message,
271                   void *closure_data);
272 typedef void (*Prometheus__ReadRequest_Closure)
273                  (const Prometheus__ReadRequest *message,
274                   void *closure_data);
275 typedef void (*Prometheus__ReadResponse_Closure)
276                  (const Prometheus__ReadResponse *message,
277                   void *closure_data);
278 typedef void (*Prometheus__Query_Closure)
279                  (const Prometheus__Query *message,
280                   void *closure_data);
281 typedef void (*Prometheus__QueryResult_Closure)
282                  (const Prometheus__QueryResult *message,
283                   void *closure_data);
284 typedef void (*Prometheus__ChunkedReadResponse_Closure)
285                  (const Prometheus__ChunkedReadResponse *message,
286                   void *closure_data);
287 
288 /* --- services --- */
289 
290 
291 /* --- descriptors --- */
292 
293 extern const ProtobufCMessageDescriptor prometheus__write_request__descriptor;
294 extern const ProtobufCMessageDescriptor prometheus__read_request__descriptor;
295 extern const ProtobufCEnumDescriptor    prometheus__read_request__response_type__descriptor;
296 extern const ProtobufCMessageDescriptor prometheus__read_response__descriptor;
297 extern const ProtobufCMessageDescriptor prometheus__query__descriptor;
298 extern const ProtobufCMessageDescriptor prometheus__query_result__descriptor;
299 extern const ProtobufCMessageDescriptor prometheus__chunked_read_response__descriptor;
300 
301 PROTOBUF_C__END_DECLS
302 
303 
304 #endif  /* PROTOBUF_C_remote_2eproto__INCLUDED */
305