line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
58
|
use utf8; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
49
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Compare; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
333
|
use strict; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
155
|
|
5
|
9
|
|
|
9
|
|
39
|
use warnings; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
243
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
48
|
use Moo; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
42
|
|
8
|
9
|
|
|
9
|
|
2740
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
101
|
|
9
|
9
|
|
|
9
|
|
7882
|
use MIME::Base64; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
455
|
|
10
|
9
|
|
|
9
|
|
53
|
use Data::Dumper; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
384
|
|
11
|
9
|
|
|
9
|
|
50
|
use JSON; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
60
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
903
|
use namespace::clean; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
58
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Compare |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.020'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Op |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 ACCESSORS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 result |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
result is logical comparison operation for this comparison. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has result => ( |
39
|
|
|
|
|
|
|
is => 'ro', |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 target |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
target is the key-value field to inspect for the comparison. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
has target => ( |
49
|
|
|
|
|
|
|
is => 'ro', |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 key |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
key is the subject key for the comparison operation. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has key => ( |
59
|
|
|
|
|
|
|
is => 'ro', |
60
|
|
|
|
|
|
|
coerce => sub { return encode_base64( $_[0], '' ) if $_[0] }, |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 version |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
version is the version of the given key |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
has version => ( |
71
|
|
|
|
|
|
|
is => 'ro', |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 create_revision |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
create_revision is the creation revision of the given key |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
has create_revision => ( |
81
|
|
|
|
|
|
|
is => 'ro', |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 mod_revision |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
mod_revision is the last modified revision of the given key. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
has mod_revision => ( |
91
|
|
|
|
|
|
|
is => 'ro', |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 value |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
value is the value of the given key, in bytes. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
has value => ( |
101
|
|
|
|
|
|
|
is => 'ro', |
102
|
|
|
|
|
|
|
coerce => sub { return encode_base64( $_[0], '' ) if $_[0] }, |
103
|
|
|
|
|
|
|
); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; |