out_nats: support config map
#include <fluent-bit/flb_utils.h>
#include <fluent-bit/flb_pack.h>
#include <fluent-bit/flb_time.h>
+#include <fluent-bit/flb_config_map.h>
#include <stdio.h>
#include <msgpack.h>
@@ -32,6 +33,7 @@ static int cb_nats_init(struct flb_output_instance *ins, struct flb_config *conf
void *data)
{
int io_flags;
+ int ret;
struct flb_upstream *upstream;
struct flb_out_nats_config *ctx;
@@ -45,6 +47,14 @@ static int cb_nats_init(struct flb_output_instance *ins, struct flb_config *conf
return -1;
}
+ /* Set default values */
+ ret = flb_output_config_map_set(ins, ctx);
+ if (ret == -1) {
+ flb_plg_error(ins, "flb_output_config_map_set failed");
+ flb_free(ctx);
+ return -1;
+ }
+
io_flags = FLB_IO_TCP;
if (ins->host.ipv6 == FLB_TRUE) {
io_flags |= FLB_IO_IPV6;
@@ -227,6 +237,11 @@ int cb_nats_exit(void *data, struct flb_config *config)
return 0;
}
+static struct flb_config_map config_map[] = {
+ /* EOF */
+ {0}
+};
+
struct flb_output_plugin out_nats_plugin = {
.name = "nats",
.description = "NATS Server",
@@ -234,4 +249,5 @@ struct flb_output_plugin out_nats_plugin = {
.cb_flush = cb_nats_flush,
.cb_exit = cb_nats_exit,
.flags = FLB_OUTPUT_NET,
+ .config_map = config_map
};
