- Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathUtil.pm
48 lines (30 loc) · 877 Bytes
/
Util.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
packageMetaCPAN::Util;
use strict;
use warnings;
use constant DEBUG=> !!$ENV{METACPAN_EXAMPLES_DEBUG};
use Search::Elasticsearch;
use Sub::Exporter -setup=> { exports=> ['es'] };
subes {
return Search::Elasticsearch->new(
client=>'2_0::Direct',
cxn_pool=>'Static::NoPing',
nodes=>'https://fastapi.metacpan.org/v1',
send_get_body_as=>'POST',
( trace_to=>'Stdout' ) x !!(DEBUG),
);
}
1;
=head1NAME
MetaCPAN::Util - Utilities for accessing MetaCPAN
=head1DESCRIPTION
Provides shared utility code for examples.
=head1FUNCTIONS
=head2es
Returns a L<Search::Elasticsearch> client configured for use with the
MetaCPAN API endpoint.
=head1ENVIRONMENT
=over4
=itemC<METACPAN_EXAMPLES_DEBUG>
When set to C<1>, enables output of verbose debugging information.
=back
=cut