line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
16
|
use utf8; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
17
|
|
2
|
|
|
|
|
|
|
package Etcd3::Lease::KeepAlive; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
135
|
use strict; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
70
|
|
5
|
4
|
|
|
4
|
|
884
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
89
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
16
|
use Moo; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
14
|
|
8
|
4
|
|
|
4
|
|
807
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
21
|
|
9
|
4
|
|
|
4
|
|
2407
|
use MIME::Base64; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
175
|
|
10
|
4
|
|
|
4
|
|
16
|
use JSON; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
19
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Etcd3::Role::Actions'; |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
417
|
use namespace::clean; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
35
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Etcd3::Lease::KeepAlive |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.005'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client |
27
|
|
|
|
|
|
|
to the server and streaming keep alive responses from the server to the client." |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 endpoint |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has endpoint => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
isa => Str, |
36
|
|
|
|
|
|
|
default => '/lease/keepalive' |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 ID |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
ID is the lease ID for the lease to keep alive. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has ID => ( |
46
|
|
|
|
|
|
|
is => 'ro', |
47
|
|
|
|
|
|
|
isa => Int, |
48
|
|
|
|
|
|
|
required => 1, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 json_args |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
arguments that will be sent to the api |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
has json_args => ( is => 'lazy', ); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub _build_json_args { |
60
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
61
|
0
|
|
|
|
|
|
my $args; |
62
|
0
|
|
|
|
|
|
for my $key ( keys %{$self} ) { |
|
0
|
|
|
|
|
|
|
63
|
0
|
0
|
|
|
|
|
unless ( $key =~ /(?:_client|json_args|endpoint)$/ ) { |
64
|
0
|
|
|
|
|
|
$args->{$key} = $self->{$key}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
0
|
|
|
|
|
|
return to_json($args); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 init |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub init { |
75
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
76
|
0
|
|
|
|
|
|
$self->json_args; |
77
|
0
|
|
|
|
|
|
return $self; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |