diff --git a/Cargo.toml b/Cargo.toml index 41320d2..7f85ab2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] clap = "4.0.32" reqwest = { version = "0.11.13", features = ["json"] } -serde = "1.0.152" +serde = { version = "1.0.152", features = ["derive"] } tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] } # Packages available in Debian (Sid) diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..ace7e6f --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,35 @@ +use serde::Deserialize; + +pub fn module_echo(){ + println!("hello from lib.rs!"); +} + +/// A struct matching a Gitea "Release" entry +#[derive(Deserialize, Debug)] +pub struct ReleaseInfo { + id: usize, + tag_name: String, + target_commitish: String, + name: String, + body: String, + url: String, + html_url: String, + tarball_url: String, + zipball_url: String, + upload_url: String, + draft: bool, + prerelease: bool, + created_at: String, + published_at: String, + author: Author +} + +#[derive(Deserialize, Debug)] +pub struct Author { + id: usize, + login: String, + login_name: String, + source_id: usize, + full_name: String, + email: String +}