line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Etcd::Response; |
2
|
|
|
|
|
|
|
$Etcd::Response::VERSION = '0.002'; |
3
|
4
|
|
|
4
|
|
15
|
use namespace::sweep; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
17
|
|
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
1490
|
use Etcd::Node; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
144
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
1853
|
use JSON qw(decode_json); |
|
4
|
|
|
|
|
27706
|
|
|
4
|
|
|
|
|
22
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
535
|
use Moo; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
26
|
|
10
|
4
|
|
|
4
|
|
1264
|
use Type::Utils qw(class_type); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
29
|
|
11
|
4
|
|
|
4
|
|
1110
|
use Types::Standard qw(Str Int); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
25
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has action => ( is => 'ro', isa => Str, required => 1 ); |
14
|
|
|
|
|
|
|
has etcd_index => ( is => 'ro', isa => Int, required => 1 ); |
15
|
|
|
|
|
|
|
has raft_index => ( is => 'ro', isa => Int, required => 1 ); |
16
|
|
|
|
|
|
|
has raft_term => ( is => 'ro', isa => Int, required => 1 ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $node_coercion = sub { ref $_[0] eq 'HASH' ? Etcd::Node->new(%{$_[0]}) : $_[0] }; |
19
|
|
|
|
|
|
|
has node => ( is => 'ro', isa => class_type('Etcd::Node'), coerce => $node_coercion, required => 1 ); |
20
|
|
|
|
|
|
|
has prev_node => ( is => 'ro', isa => class_type('Etcd::Node'), coerce => $node_coercion, init_arg => 'prevNode' ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new_from_http { |
23
|
5
|
|
|
5
|
0
|
10
|
my ($class, $res) = @_; |
24
|
5
|
|
|
|
|
60
|
my $data = decode_json($res->{content}); |
25
|
5
|
|
|
|
|
10
|
my %headers; |
26
|
5
|
|
|
|
|
9
|
@headers{qw(etcd_index raft_index raft_term)} = @{$res->{headers}}{qw(x-etcd-index x-raft-index x-raft-term)}; |
|
5
|
|
|
|
|
24
|
|
27
|
5
|
|
|
|
|
71
|
$class->new(%$data, %headers); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |