1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct StreamConfig {
6 pub name: String,
8
9 pub retention: Option<RetentionPolicy>,
11}
12
13#[derive(Debug, Clone, Serialize, Deserialize)]
15pub enum RetentionPolicy {
16 KeepAll,
18
19 KeepDays(u64),
21
22 KeepCount(u64),
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct ConsumerMetadata {
29 pub name: String,
31
32 pub stream: String,
34
35 pub created_at: chrono::DateTime<chrono::Utc>,
37
38 pub last_ack_at: Option<chrono::DateTime<chrono::Utc>>,
40}
41
42impl ConsumerMetadata {
43 pub fn new(stream: String, name: String) -> Self {
44 Self {
45 name,
46 stream,
47 created_at: chrono::Utc::now(),
48 last_ack_at: None,
49 }
50 }
51}