github_analytics/
models.rs

1use chrono::{DateTime, Utc};
2use clap::Parser;
3use influxdb::InfluxDbWriteable;
4
5#[derive(InfluxDbWriteable, Debug, Clone)]
6pub struct Interaction {
7    pub time: DateTime<Utc>,
8    pub interaction_type: String,
9    pub author: String,
10    #[influxdb(tag)]
11    pub repo: String,
12}
13
14#[derive(Parser)]
15#[command(author, version, about, long_about = None)]
16pub struct Cli {
17    /// Should print the summary.
18    #[clap(long, short, action)]
19    pub print: bool,
20    /// Should save the data in an influxdb instance.
21    #[clap(long, short, action)]
22    pub db: bool,
23    /// Number of days in the past the data analysis should start.
24    pub start: u64,
25}