File Coverage

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


line stmt bran cond sub pod time code
1             package Types::ElasticSearch;
2             # ABSTRACT: Types for working with ElasticSearch
3              
4 6     6   412399 use v5.16;
  6         22  
5 6     6   44 use warnings;
  6         12  
  6         556  
6              
7             our $VERSION = '8.8'; # VERSION
8              
9 6     6   641 use Type::Library -base;
  6         56167  
  6         109  
10 6     6   1337 use Type::Tiny;
  6         38  
  6         1173  
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.8
34              
35             =head1 AUTHOR
36              
37             Brad Lhotsky <brad@divisionbyzero.net>
38              
39             =head1 COPYRIGHT AND LICENSE
40              
41             This software is Copyright (c) 2024 by Brad Lhotsky.
42              
43             This is free software, licensed under:
44              
45             The (three-clause) BSD License
46              
47             =cut