line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Fastly::VCL; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
16
|
use strict; |
|
4
|
|
|
|
|
29
|
|
|
4
|
|
|
|
|
116
|
|
4
|
4
|
|
|
4
|
|
13
|
use base qw(Net::Fastly::BelongsToServiceAndVersion); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
620
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Net::Fastly::VCL->mk_accessors(qw(service_id name content comment main)); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::Fastly::VCL - An internal representation of a Varnish Configuration Language file |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 ACCESSORS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head2 service_id |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
The id of the service this belongs to. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 version |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
The number of the version this belongs to. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 name |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
The domain name of this domain |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 content |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The content of the VCL file. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
See this for more details |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
https://www.varnish-cache.org/trac/wiki/VCL |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 comment |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
a free form comment field |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package Net::Fastly; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Temporary hack |
43
|
|
|
|
|
|
|
sub get_vcl { |
44
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
0
|
|
|
|
|
|
my $class = 'Net::Fastly::VCL'; |
46
|
0
|
|
|
|
|
|
my $service = shift; |
47
|
0
|
|
|
|
|
|
my $version = shift; |
48
|
0
|
|
|
|
|
|
my $name = shift; |
49
|
0
|
|
|
|
|
|
my %opts = @_; |
50
|
0
|
|
|
|
|
|
my $hash = $self->client->_get($class->_get_path($service, $version, $name), %opts); |
51
|
0
|
0
|
|
|
|
|
return undef unless $hash; |
52
|
0
|
|
|
|
|
|
return $class->new($self, %$hash); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
1; |