Struct gitlab_api::gitlab::GitLab [] [src]

pub struct GitLab { /* fields omitted */ }

Methods

impl GitLab
[src]

Build a URL used to access GitLab instance, including some parameters.

Examples

Example from GitLab: https://docs.gitlab.com/ce/api/#basic-usage

use gitlab_api::GitLab;

let expected_url = "https://gitlab.example.com\
                    /api/v3/groups?order_by=path&private_token=XXXXXXXXXXXXXXXXXXXX";

let gl = GitLab::new("gitlab.example.com", "XXXXXXXXXXXXXXXXXXXX").unwrap();

assert_eq!(gl.build_url("groups?order_by=path").unwrap(), expected_url);

Set pagination information

Examples

use gitlab_api::{GitLab, Pagination};

let expected_url = "https://gitlab.example.com\
                    /api/v3/groups?order_by=path&\
                    private_token=XXXXXXXXXXXXXXXXXXXX&page=2&per_page=5";

let mut gl = GitLab::new("gitlab.example.com", "XXXXXXXXXXXXXXXXXXXX").unwrap();
gl.set_pagination(Pagination {page: 2, per_page: 5});
assert_eq!(gl.build_url("groups?order_by=path").unwrap(), expected_url);

Trait Implementations

impl Debug for GitLab
[src]

Formats the value using the given formatter.