line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
64
|
use utf8; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
58
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::KV::Compare; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
361
|
use strict; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
201
|
|
5
|
9
|
|
|
9
|
|
60
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
258
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
51
|
use Moo; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
52
|
|
8
|
9
|
|
|
9
|
|
3126
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
29
|
|
|
9
|
|
|
|
|
67
|
|
9
|
9
|
|
|
9
|
|
9411
|
use MIME::Base64; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
514
|
|
10
|
9
|
|
|
9
|
|
80
|
use Data::Dumper; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
504
|
|
11
|
9
|
|
|
9
|
|
65
|
use JSON; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
80
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
1137
|
use namespace::clean; |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
72
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::KV::Compare |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.021'; |
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; |