{"id":20195889,"url":"https://github.com/chenaoxd/gritlab","last_synced_at":"2025-09-07T11:34:09.929Z","repository":{"id":62439788,"uuid":"463935261","full_name":"chenaoxd/gritlab","owner":"chenaoxd","description":"Gritlab is a async gitlab API sdk.","archived":false,"fork":false,"pushed_at":"2022-09-04T15:17:14.000Z","size":124,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T08:36:29.329Z","etag":null,"topics":["gitlab","gitlab-api","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenaoxd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-26T18:32:41.000Z","updated_at":"2025-02-28T08:03:30.000Z","dependencies_parsed_at":"2022-11-01T22:00:48.566Z","dependency_job_id":null,"html_url":"https://github.com/chenaoxd/gritlab","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenaoxd%2Fgritlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenaoxd%2Fgritlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenaoxd%2Fgritlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenaoxd%2Fgritlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenaoxd","download_url":"https://codeload.github.com/chenaoxd/gritlab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629771,"owners_count":19993710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab","gitlab-api","rust"],"created_at":"2024-11-14T04:19:57.244Z","updated_at":"2025-03-03T08:13:20.324Z","avatar_url":"https://github.com/chenaoxd.png","language":"Rust","readme":"# Gritlab\n\n`Gritlab` is a async gitlab API sdk.\n\n\n[![Crates.io][crates-badge]][crates-url]\n[![MIT licensed][mit-badge]][mit-url]\n\n[crates-badge]: https://img.shields.io/crates/v/gritlab.svg\n[crates-url]: https://crates.io/crates/gritlab\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit-url]: https://github.com/chenaoxd/gritlab/blob/master/LICENSE\n\n\n## Usage example\n\n```rust\nuse std::env;\n\nuse anyhow::Context;\nuse gritlab::{\n    client::Gritlab, hook::CreateHookOption, status::CreateStatusOption, Result,\n};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    let (owner, repo) = (\"chenao\", \"test-jarvis\");\n    let commit_id = \"ff0e6ddd616ffabfc02d6943b2aed496fca2c63c\";\n\n    let host = env::var(\"HOST\")\n        .with_context(|| format!(\"get environment variable HOST failed\"))?;\n    let access_token = env::var(\"ACCESS_TOKEN\")\n        .with_context(|| format!(\"get environment variable ACCESS_TOKEN failed\"))?;\n\n    let cli = Gritlab::builder(host).token(access_token).build()?;\n\n    let user = cli.current_user().await?;\n    println!(\"current_user: {:#?}\", user);\n\n    let _repos = cli.list_repos().await?;\n    // println!(\"repos: {:#?}\", repos);\n\n    let repo_ = cli.get_repo(owner, repo).await?;\n    println!(\"repo: {:#?}\", repo_);\n\n    let hook = cli\n        .create_hook(\n            owner,\n            repo,\n            \u0026CreateHookOption::new(\n                \"https://foo.bar/hook\",\n                Some(\"demo_token\".to_string()),\n            ),\n        )\n        .await?;\n    println!(\"new hook: {:#?}\", hook);\n\n    let hooks = cli.list_hooks(owner, repo).await?;\n    println!(\"hooks: {:#?}\", hooks);\n\n    cli.delete_hook(owner, repo, hook.id).await?;\n    println!(\"hook deleted\");\n\n    let status = cli\n        .create_status(\n            owner,\n            repo,\n            commit_id,\n            \u0026CreateStatusOption {\n                state: \"failed\".to_string(),\n                ref_: None,\n                name: Some(\"jarvis\".to_string()),\n                target_url: Some(\"https://jarvis.chenaoxd.com/repo/1/jobs\".to_string()),\n                description: Some(\"some description\".to_string()),\n                coverage: None,\n                pipeline_id: None,\n            },\n        )\n        .await?;\n    println!(\"created status: {:#?}\", status);\n\n    let statuses = cli.list_statuses(owner, repo, commit_id).await?;\n    println!(\"statuses: {:#?}\", statuses);\n\n    Ok(())\n}\n```\n\n## License\n\nThis project is licensed under the [MIT license](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenaoxd%2Fgritlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenaoxd%2Fgritlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenaoxd%2Fgritlab/lists"}