line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
46
|
use utf8; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
53
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Op; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
298
|
use strict; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
127
|
|
5
|
9
|
|
|
9
|
|
37
|
use warnings; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
154
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
32
|
use Moo; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
34
|
|
8
|
9
|
|
|
9
|
|
2262
|
use Types::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
56
|
|
9
|
9
|
|
|
9
|
|
7264
|
use MIME::Base64; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
391
|
|
10
|
9
|
|
|
9
|
|
47
|
use Data::Dumper; |
|
9
|
|
|
|
|
30
|
|
|
9
|
|
|
|
|
352
|
|
11
|
9
|
|
|
9
|
|
44
|
use JSON; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
39
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
773
|
use namespace::clean; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
40
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Op |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.022'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Op |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 ACCESSORS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 request_range |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has request_range => ( |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 request_put |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has request_put => ( |
44
|
|
|
|
|
|
|
is => 'ro', |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 request_delete_range |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has request_delete_range => ( |
52
|
|
|
|
|
|
|
is => 'ro', |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 create |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
create op |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
#TODO this dirty hack should be a perl data object and then make json. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub create { |
64
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
65
|
0
|
|
|
|
|
|
my @op; |
66
|
0
|
|
|
|
|
|
my $put = $self->request_put; |
67
|
0
|
|
|
|
|
|
my $range = $self->request_range; |
68
|
0
|
|
|
|
|
|
my $delete_range = $self->request_delete_range; |
69
|
0
|
0
|
|
|
|
|
push @op, '{"requestPut":' . $put->json_args . '}' if defined $put; |
70
|
0
|
0
|
|
|
|
|
push @op, '{"requestRange":' . $range->json_args . '}' if defined $range; |
71
|
0
|
0
|
|
|
|
|
push @op, '{"requestDeleteRange":' . $delete_range->json_args . '}' if defined $delete_range; |
72
|
0
|
|
|
|
|
|
return @op; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |