| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Types::GitLab; |
|
2
|
|
|
|
|
|
|
$Types::GitLab::VERSION = '0.01'; |
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Types::GitLab - Type::Tiny types for GitLab stuff. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Foo; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Types::GitLab -types; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Moo; |
|
14
|
|
|
|
|
|
|
use strictures 1; |
|
15
|
|
|
|
|
|
|
use namespace::clean; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has token => ( |
|
18
|
|
|
|
|
|
|
is => 'ro', |
|
19
|
|
|
|
|
|
|
isa => GitLabToken, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
L is an open source git server. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This module provides several L types for several of |
|
27
|
|
|
|
|
|
|
GitLab's data types. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
|
30
|
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
16530
|
use Type::Library -base; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use Type::Utils -all; |
|
33
|
|
|
|
|
|
|
use Types::Standard -types; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
use strictures 1; |
|
36
|
|
|
|
|
|
|
use namespace::clean; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 TYPES |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 GitLabUsername |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Username can contain only letters, digits, '_', '-' and '.'. It must |
|
43
|
|
|
|
|
|
|
start with letter, digit or '_', optionally preceeded by '.'. It must |
|
44
|
|
|
|
|
|
|
not end in '.git'. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
declare 'GitLabUsername', |
|
49
|
|
|
|
|
|
|
as Str, |
|
50
|
|
|
|
|
|
|
where { |
|
51
|
|
|
|
|
|
|
length($_) > 0 and |
|
52
|
|
|
|
|
|
|
$_ !~ m{[^A-Za-z0-9_.-]} and |
|
53
|
|
|
|
|
|
|
$_ =~ m{^[A-Za-z_]} and |
|
54
|
|
|
|
|
|
|
$_ !~ m{\.git$} |
|
55
|
|
|
|
|
|
|
}; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 GitLabToken |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
The API token for a user. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
declare 'GitLabToken', |
|
64
|
|
|
|
|
|
|
as Str, |
|
65
|
|
|
|
|
|
|
where { length($_) == 20 and $_ !~ m{[^a-zA-Z0-9]} }; |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
|
68
|
|
|
|
|
|
|
__END__ |