line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
57
|
use utf8; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
63
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Op; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
331
|
use strict; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
158
|
|
5
|
9
|
|
|
9
|
|
36
|
use warnings; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
187
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
36
|
use Moo; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
80
|
|
8
|
9
|
|
|
9
|
|
2786
|
use Types::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
60
|
|
9
|
9
|
|
|
9
|
|
8672
|
use MIME::Base64; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
440
|
|
10
|
9
|
|
|
9
|
|
50
|
use Data::Dumper; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
432
|
|
11
|
9
|
|
|
9
|
|
55
|
use JSON; |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
67
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
981
|
use namespace::clean; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
50
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Op |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.020'; |
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; |