1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! `NATS` sink
//! Publishes data using [NATS](nats.io)(Neural Autonomic Transport System).

use snafu::Snafu;

use crate::nats::NatsConfigError;

mod config;
#[cfg(feature = "nats-integration-tests")]
#[cfg(test)]
mod integration_tests;
mod request_builder;
mod service;
mod sink;
#[cfg(test)]
mod tests;

#[derive(Debug, Snafu)]
enum NatsError {
    #[snafu(display("invalid encoding: {}", source))]
    Encoding {
        source: vector_lib::codecs::encoding::BuildError,
    },
    #[snafu(display("NATS Config Error: {}", source))]
    Config { source: NatsConfigError },
    #[snafu(display("NATS Connect Error: {}", source))]
    Connect { source: async_nats::ConnectError },
    #[snafu(display("NATS Server Error: {}", source))]
    ServerError { source: async_nats::Error },
    #[snafu(display("NATS Publish Error: {}", source))]
    PublishError { source: async_nats::Error },
}