#gitlab #github #api-bindings

bin+lib gitforge

uniform access to git forges (gitlab and github)

2 unstable releases

0.2.0 Jun 28, 2021
0.1.0 Jun 18, 2021

#59 in #gitlab

21 downloads per month
Used in xensec-internal-tools

MIT/Apache

54KB
1K SLoC

Uniform access to github and gitlab

Currently, listing and creating merge requests is suppored.

Example

use gitforge::forge;

let mut f = forge::Config {
  kind: "github".parse().ok(),
  host: "github.com".into(),
  ..Default::default()
}
  .load_default_token().unwrap()
  .forge().unwrap();

let req = forge::Req::MergeRequests(forge::Req_MergeRequests{
  target_repo: "CVEProject/cvelist".into(),
  statuses: Some([forge::IssueMrStatus::Open].iter().cloned().collect()),
  ..Default::default()
});

match f.request(&req).unwrap() {
  forge::Resp::MergeRequests { mrs,.. } => {
    for mr in mrs {
      println!("{:?}", &mr);
    }
  },
  x => panic!("unexpected response {:?}", &x),
};

Dependencies

~7–22MB
~321K SLoC