Add structs to represent API results
So far it's just a pair that work together to do the repo list results.
This commit is contained in:
@@ -6,7 +6,7 @@ edition = "2024"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.0.32"
|
clap = "4.0.32"
|
||||||
reqwest = { version = "0.11.13", features = ["json"] }
|
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"] }
|
tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] }
|
||||||
|
|
||||||
# Packages available in Debian (Sid)
|
# Packages available in Debian (Sid)
|
||||||
|
|||||||
35
src/lib.rs
Normal file
35
src/lib.rs
Normal file
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user