File Coverage

blib/lib/Docker/Registry/ECR.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Docker::Registry::ECR;
2 1     1   13936 use Moo;
  1         3  
  1         7  
3 1     1   418 use Types::Standard qw/Str/;
  1         3  
  1         7  
4             extends 'Docker::Registry::V2';
5              
6             has '+url' => (lazy => 1, default => sub {
7             my $self = shift;
8             die "Must specify account_id and region in constructor" if (not defined $self->account_id or
9             not defined $self->region);
10             sprintf 'https://%s.dkr.ecr.%s.amazonaws.com', $self->account_id, $self->region;
11             });
12              
13             around build_auth => sub {
14             my ($orig, $self) = @_;
15             require Docker::Registry::Auth::ECR;
16             Docker::Registry::Auth::ECR->new(region => $self->region);
17             };
18              
19             has account_id => (is => 'ro', isa => Str);
20             has region => (is => 'ro', isa => Str);
21              
22             1;