aboutsummaryrefslogtreecommitdiffstats
path: root/crates/router/src/cnfg.rs
blob: 3f6e5630e3bb8833d2d66b1445cd3e31cd31054d (plain)
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
use std::sync::Arc;

use serde::Deserialize;

pub const CACHE_KEY: i32 = 0;

#[derive(Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct LocalConfig {
    pub config_endpoint: Arc<str>,
    pub nats: Nats,
}

#[derive(Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct Nats {
    #[serde(rename = "stream-name")]
    pub name: Arc<str>,
    pub subjects: Arc<[String]>,
    pub destination_prefix: Arc<str>,
    pub max_messages: i64,
    pub durable_name: Arc<str>,
    pub config: ConfigNats,
}

#[derive(Deserialize, Clone)]
pub struct ConfigNats {
    #[serde(rename = "stream")]
    pub stream: Arc<str>,
    #[serde(rename = "reload-subject")]
    pub reload_subject: Arc<str>,
}