lib/IO/K8s/Role/MiddlewareTCPBuilder.pm

filter: Statementstmt 100% 15 / 15 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 3 / 3 totaltotal 95.8% 23 / 24 CC 2 SCAR 3.5
CC
2
Cov
94%
in_flight_conn
2.0
BEGIN
1.0
ip_allow_list
1.0
CRAP 1.4
« lib/IO/K8s/GatewayAPI/V1beta1/HTTPRoute.pm ↑ Summary lib/IO/K8s/AgentSandbox.pm »
1 package IO::K8s::Role::MiddlewareTCPBuilder;
2 # ABSTRACT: Role for building Traefik TCP middleware configuration
3 7 our $VERSION = '1.112';
4 7 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # The fluent setters below build the spec through IO::K8s::Role::SpecBuilder
7 # rather than by hand, so that role is a hard dependency of this one (k103).
8 # IO::K8s::Role::APIObject composes SpecBuilder for every top-level Kind, so
9 # these are satisfied for anything built with IO::K8s::APIObject; a class
10 # that composes this role without them now fails at composition time,
11 # naming the missing method, instead of at the first setter call.
12 7 requires qw( spec_set );
13  
14  
15 2 ▶sub in_flight_conn {
Subroutine in_flight_conn: called CC=2 SCAR=7.1
Pod documented
16 2 my ($self, $amount) = @_;
17 2 ▶ $self->spec_set('inFlightConn', {
Branch: 1 branch
BranchTrueFalseTotal
defined $amount ? : 2 0 2
18 defined $amount ? (amount => $amount) : (),
19 });
20 2 return $self;
21 }
22  
23  
24 3 ▶sub ip_allow_list {
Subroutine ip_allow_list: called CC=1 SCAR=0.0
Pod documented
25 3 my ($self, @ranges) = @_;
26 3 $self->spec_set('ipAllowList', { sourceRange => \@ranges });
27 3 return $self;
28 }
29  
30  
31 2 ▶sub ip_white_list {
Subroutine ip_white_list: called CC=1 SCAR=0.0
Pod documented
32 2 my ($self, @ranges) = @_;
33 2 $self->spec_set('ipWhiteList', { sourceRange => \@ranges });
34 2 return $self;
35 }
36  
37 7 1;
38  
39 __END__
« lib/IO/K8s/GatewayAPI/V1beta1/HTTPRoute.pm ↑ Summary lib/IO/K8s/AgentSandbox.pm »