line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
60
|
use utf8; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
77
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Op; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
367
|
use strict; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
208
|
|
5
|
9
|
|
|
9
|
|
62
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
261
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
46
|
use Moo; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
58
|
|
8
|
9
|
|
|
9
|
|
3164
|
use Types::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
67
|
|
9
|
9
|
|
|
9
|
|
10779
|
use MIME::Base64; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
531
|
|
10
|
9
|
|
|
9
|
|
63
|
use Data::Dumper; |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
478
|
|
11
|
9
|
|
|
9
|
|
86
|
use JSON; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
64
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
1125
|
use namespace::clean; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
75
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Op |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.021'; |
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; |