File Coverage

blib/lib/Types/ElasticSearch.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Types::ElasticSearch;
2             # ABSTRACT: Types for working with ElasticSearch
3              
4 2     2   14 use strict;
  2         3  
  2         56  
5 2     2   11 use warnings;
  2         3  
  2         87  
6              
7             our $VERSION = '8.5'; # VERSION
8              
9 2     2   11 use Type::Library -base;
  2         4  
  2         16  
10 2     2   518 use Type::Tiny;
  2         4  
  2         304  
11              
12             my $TimeConstant = Type::Tiny->new(
13             name => "TimeConstant",
14             constraint => sub { defined($_) && /^\d+(y|M|w|d|h|m|s|ms)$/ },
15             message => sub {
16             "must be time constant: https://www.elastic.co/guide/en/elasticsearch/reference/master/common-options.html#time-units"
17             },
18             );
19              
20             __PACKAGE__->meta->add_type($TimeConstant);
21             __PACKAGE__->meta->make_immutable;
22              
23             __END__
24              
25             =pod
26              
27             =head1 NAME
28              
29             Types::ElasticSearch - Types for working with ElasticSearch
30              
31             =head1 VERSION
32              
33             version 8.5
34              
35             =head1 AUTHOR
36              
37             Brad Lhotsky <brad@divisionbyzero.net>
38              
39             =head1 COPYRIGHT AND LICENSE
40              
41             This software is Copyright (c) 2023 by Brad Lhotsky.
42              
43             This is free software, licensed under:
44              
45             The (three-clause) BSD License
46              
47             =cut