README.md 1.14 KB
Newer Older
Roman Lacko's avatar
Roman Lacko committed
1
# GitLab::API
Roman Lacko's avatar
Roman Lacko committed
2

Roman Lacko's avatar
Roman Lacko committed
3
Lightweight implementation of [GitLab CE API](https://docs.gitlab.com/ce/api/) in Perl.
Roman Lacko's avatar
Roman Lacko committed
4
5
6

## Quick start

Roman Lacko's avatar
Roman Lacko committed
7
```perl
Roman Lacko's avatar
Roman Lacko committed
8
9
10
11
12
13
14
15
use GitLab;

my $gitlab = GitLab::API->new(
    URL        => "https://gitlab.fi.muni.cz/api/v3",
    AuthToken  => "...",
    DieOnError => 1
);

Roman Lacko's avatar
Roman Lacko committed
16
my $users  = $gitlab->users(-iterator => 1);
Roman Lacko's avatar
Roman Lacko committed
17
18

say "Users in GitLab:";
Roman Lacko's avatar
Roman Lacko committed
19
while (my $user = $users->next) {
Roman Lacko's avatar
Roman Lacko committed
20
21
22
    say $user->{name};
}

Roman Lacko's avatar
Roman Lacko committed
23
my $groups = $gitlab->groups(search => "pb161");
Roman Lacko's avatar
Roman Lacko committed
24
25
26
27
28
```

## Documentation

- [official GitLab API documentation](https://docs.gitlab.com/ce/api/)
29
- [`GitLab::API` wiki](https://gitlab.fi.muni.cz/xlacko1/gitlab_api/wikis/home)
Roman Lacko's avatar
Roman Lacko committed
30
31
32
33
34
35
36
37
38
39

## Dependencies

- [`HTTP::Headers`](https://metacpan.org/pod/HTTP::Headers)
- [`JSON`](https://metacpan.org/pod/JSON)
- [`Log::Any`](https://metacpan.org/pod/Log::Any)
- [`LWP::UserAgent`](https://metacpan.org/pod/LWP::UserAgent)
- [`LWP::Protocol::https`](https://metacpan.org/pod/LWP::Protocol::https)
- [`Try::Tiny`](https://metacpan.org/pod/Try::Tiny)
- [`URI`](https://metacpan.org/pod/URI)
Roman Lacko's avatar
Roman Lacko committed
40
41
42
43
- [`URI::QueryParam`](https://metacpan.org/pod/URI::QueryParam)

## Author

Roman Lacko's avatar
Roman Lacko committed
44
Roman Lacko <[`xlacko1@fi.muni.cz`](mailto:xlacko1@fi.muni.cz)>