line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
45
|
use utf8; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
37
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Compare; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
263
|
use strict; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
144
|
|
5
|
9
|
|
|
9
|
|
29
|
use warnings; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
180
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
38
|
use Moo; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
36
|
|
8
|
9
|
|
|
9
|
|
2114
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
44
|
|
9
|
9
|
|
|
9
|
|
6406
|
use MIME::Base64; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
342
|
|
10
|
9
|
|
|
9
|
|
47
|
use Data::Dumper; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
317
|
|
11
|
9
|
|
|
9
|
|
36
|
use JSON; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
35
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
712
|
use namespace::clean; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
34
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Compare |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.022'; |
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; |