line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AWS::Lambda::Quick::Processor; |
2
|
1
|
|
|
1
|
|
285372
|
use Mo qw( default required ); |
|
1
|
|
|
|
|
520
|
|
|
1
|
|
|
|
|
6
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.0002'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
2136
|
use AWS::Lambda::Quick::CreateZip (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
562
|
use AWS::Lambda::Quick::Upload (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
8
|
1
|
|
|
1
|
|
9
|
use File::Temp qw( tempdir ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
77
|
|
9
|
1
|
|
|
1
|
|
6
|
use Path::Tiny qw( path ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
335
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has name => required => 1; |
12
|
|
|
|
|
|
|
has src_filename => required => 1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'description'; |
15
|
|
|
|
|
|
|
has 'extra_files'; |
16
|
|
|
|
|
|
|
has 'extra_layers'; |
17
|
|
|
|
|
|
|
has 'memory_size'; |
18
|
|
|
|
|
|
|
has 'region'; |
19
|
|
|
|
|
|
|
has 'stage_name'; |
20
|
|
|
|
|
|
|
has 'timeout'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has _tempdir => sub { |
23
|
|
|
|
|
|
|
return tempdir( CLEANUP => 1 ); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
has zip_filename => sub { |
26
|
|
|
|
|
|
|
return path( shift->_tempdir, 'handler.zip' ); |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub selfkv { |
30
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
31
|
0
|
|
|
|
|
|
my @computed_args; |
32
|
0
|
|
|
|
|
|
for my $key (@_) { |
33
|
0
|
|
|
|
|
|
my $val = $self->$key; |
34
|
0
|
0
|
|
|
|
|
push @computed_args, $key => $val if defined $val; |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
return @computed_args; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub process { |
40
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
AWS::Lambda::Quick::CreateZip->new( |
43
|
|
|
|
|
|
|
$self->selfkv( |
44
|
|
|
|
|
|
|
qw( |
45
|
|
|
|
|
|
|
extra_files |
46
|
|
|
|
|
|
|
src_filename |
47
|
|
|
|
|
|
|
zip_filename |
48
|
|
|
|
|
|
|
) |
49
|
|
|
|
|
|
|
), |
50
|
|
|
|
|
|
|
)->create_zip; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $uploader = AWS::Lambda::Quick::Upload->new( |
53
|
|
|
|
|
|
|
$self->selfkv( |
54
|
|
|
|
|
|
|
qw( |
55
|
|
|
|
|
|
|
description |
56
|
|
|
|
|
|
|
extra_layers |
57
|
|
|
|
|
|
|
memory_size |
58
|
|
|
|
|
|
|
name |
59
|
|
|
|
|
|
|
region |
60
|
|
|
|
|
|
|
stage_name |
61
|
|
|
|
|
|
|
timeout |
62
|
|
|
|
|
|
|
zip_filename |
63
|
|
|
|
|
|
|
) |
64
|
|
|
|
|
|
|
), |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
if ( $ENV{AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY} ) { |
68
|
0
|
|
|
|
|
|
$uploader->just_update_function_code; |
69
|
0
|
|
|
|
|
|
return q{}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
$uploader->upload; |
73
|
0
|
|
|
|
|
|
return $uploader->api_url; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 NAME |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
AWS::Lambda::Quick::Processor - main object class for AWS::Lambda::Quick |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 DESCRIPTION |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
No user servicable parts. See L<AWS::Lambda::Quick> for usage. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Written by Mark Fowler B<mark@twoshortplanks.com> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Copyright Mark Fowler 2019. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
95
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SEE ALSO |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L<AWS::Lambda::Quick> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |