/*
 * Copyright (c) 2014 Pierre-Yves Ritschard <pyr@spootnik.org>
 * Copyright (c) 2013-2019 Balabit
 * Copyright (c) 2019 Balazs Scheidler
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published
 * by the Free Software Foundation, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * As an additional exemption you are allowed to compile & link against the
 * OpenSSL libraries as published by the OpenSSL project. See the file
 * COPYING for details.
 *
 */

#ifndef KAFKA_DEST_DRIVER_H_INCLUDED
#define KAFKA_DEST_DRIVER_H_INCLUDED

#include "logthrdest/logthrdestdrv.h"

typedef struct _KafkaDestDriver KafkaDestDriver;
typedef struct _KafkaDestinationOptions KafkaDestinationOptions;

void kafka_dd_merge_config(LogDriver *d, GList *props);
void kafka_dd_set_topic(LogDriver *d, LogTemplate *topic);
void kafka_dd_set_fallback_topic(LogDriver *d, const gchar *fallback_topic);
gboolean kafka_dd_set_logging(LogDriver *d, const gchar *logging);
void kafka_dd_set_bootstrap_servers(LogDriver *d, const gchar *bootstrap_servers);
void kafka_dd_set_key_ref(LogDriver *d, LogTemplate *key);
void kafka_dd_set_message_ref(LogDriver *d, LogTemplate *message);
void kafka_dd_set_flush_timeout_on_shutdown(LogDriver *d, gint shutdown_timeout);
void kafka_dd_set_flush_timeout_on_reload(LogDriver *d, gint reload_timeout);
void kafka_dd_set_poll_timeout(LogDriver *d, gint poll_timeout);
void kafka_dd_set_transaction_commit(LogDriver *d, gboolean transaction_commit);

gboolean kafka_dd_is_topic_name_a_template(KafkaDestDriver *self);
LogTemplateOptions *kafka_dd_get_template_options(LogDriver *d);

gboolean kafka_dd_reopen(LogDriver *d);
void kafka_dd_shutdown(LogThreadedDestDriver *s);

LogDriver *kafka_dd_new(GlobalConfig *cfg);

#endif
