nmsg 1.3.1
kafkaio.h
1/*
2 * Copyright (c) 2024 DomainTools LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef NMSG_KAFKAIO_H
18#define NMSG_KAFKAIO_H
19
23typedef struct kafka_ctx * kafka_ctx_t;
24
30void kafka_ctx_destroy(kafka_ctx_t *ctx);
31
40kafka_ctx_t kafka_create_consumer(const char *addr, int timeout);
41
50kafka_ctx_t kafka_create_producer(const char *addr, int timeout);
51
62nmsg_res kafka_read_start(kafka_ctx_t ctx, uint8_t **buf, size_t *len);
63
71nmsg_res kafka_read_finish(kafka_ctx_t ctx);
72
88nmsg_res kafka_write(kafka_ctx_t ctx,
89 const uint8_t *key, size_t key_len,
90 uint8_t *buf, size_t buf_len);
91
97void kafka_stop(kafka_ctx_t ctx);
98
104void kafka_flush(kafka_ctx_t ctx);
105
106#endif /* NMSG_KAFKAIO_H */
nmsg_res
nmsg result code
Definition: res.h:25