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
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
use futures::{sync::mpsc::UnboundedReceiver, Stream};
use serde_json::Value;

#[derive(Debug)]
pub struct OutputBlock(pub Vec<Output>);

#[derive(Debug)]
pub enum Output {
    Stdout(Stdout),
}

impl OutputBlock {
    pub fn run(self, outputs_receiver: UnboundedReceiver<Value>) {
        let broadcast = outputs_receiver.for_each(move |message| {
            self.0.iter().for_each(move |output| {
                // TODO: make async
                match output {
                    Output::Stdout(p) => p.run(message.clone()),
                };
            });

            Ok(())
        });

        tokio::spawn(broadcast);
    }
}

trait Run {
    fn run(&self, input: Value);
}

mod boundary;
mod circonus;
mod cloudwatch;
mod csv;
mod datadog;
mod datadog_metrics;
mod elastic_app_search;
mod elasticsearch;
mod email;
mod exec;
mod file;
mod ganglia;
mod gelf;
mod google_bigquery;
mod google_pubsub;
mod graphite;
mod http;
mod influxdb;
mod irc;
mod juggernaut;
mod kafka;
mod librato;
mod loggly;
mod lumberjack;
mod metriccatcher;
mod mongodb;
mod nagios;
mod nagios_nsca;
mod opentsdb;
mod pagerduty;
mod pipe;
mod rabbitmq;
mod redis;
mod redmine;
mod riak;
mod riemann;
mod s3;
mod sns;
mod solr_http;
mod sqs;
mod statsd;
mod stdout;
mod stomp;
mod syslog;
mod tcp;
mod timber;
mod udp;
mod webhdfs;
mod websocket;
mod xmpp;
mod zabbix;

pub use self::http::*;
pub use boundary::*;
pub use circonus::*;
pub use cloudwatch::*;
pub use csv::*;
pub use datadog::*;
pub use datadog_metrics::*;
pub use elastic_app_search::*;
pub use elasticsearch::*;
pub use email::*;
pub use exec::*;
pub use file::*;
pub use ganglia::*;
pub use gelf::*;
pub use google_bigquery::*;
pub use google_pubsub::*;
pub use graphite::*;
pub use influxdb::*;
pub use irc::*;
pub use juggernaut::*;
pub use kafka::*;
pub use librato::*;
pub use loggly::*;
pub use lumberjack::*;
pub use metriccatcher::*;
pub use mongodb::*;
pub use nagios::*;
pub use nagios_nsca::*;
pub use opentsdb::*;
pub use pagerduty::*;
pub use pipe::*;
pub use rabbitmq::*;
pub use redis::*;
pub use redmine::*;
pub use riak::*;
pub use riemann::*;
pub use s3::*;
pub use sns::*;
pub use solr_http::*;
pub use sqs::*;
pub use statsd::*;
pub use stdout::*;
pub use stomp::*;
pub use syslog::*;
pub use tcp::*;
pub use timber::*;
pub use udp::*;
pub use webhdfs::*;
pub use websocket::*;
pub use xmpp::*;
pub use zabbix::*;