Dancer-SearchApp
view release on metacpan or search on metacpan
bin/index-url.pl view on Meta::CPAN
print "Reading ES indices\n";
await $e->indices->get({index => ['*']})->then(sub{
%indices = %{ $_[0]};
});
warn "Index: $_\n" for grep { /^\Q$index_name/ } keys %indices;
# Connect to cluster at search1:9200, sniff all nodes and round-robin between them:
# Lame-ass config cascade
# Read from %ENV, $config, hard defaults, with different names,
# write to yet more different names
# Should merge with other config cascade
sub get_defaults {
my( %options ) = @_;
$options{ defaults } ||= {}; # premade defaults
my @names = @{ $options{ names } };
if( ! exists $options{ env }) {
$options{ env } = \%ENV;
};
my $env = $options{ env };
my $config = $options{ config };
lib/Dancer/SearchApp/Defaults.pm view on Meta::CPAN
package Dancer::SearchApp::Defaults;
use strict;
use Exporter 'import';
use Data::Diver qw<DiveRef Dive >;
use vars qw($VERSION @EXPORT_OK %defaults);
$VERSION = '0.06';
# This should move to Config::Spec::FromPod
# and maybe even Config::Collect
# instead of hand rolling yet another cascade
@EXPORT_OK = qw(
get_defaults
);
%defaults = (
);
=head1 FUNCTIONS
lib/Dancer/SearchApp/Defaults.pm view on Meta::CPAN
names => [
# hash-name, config-name, env-name, (hard-default)
[ Server => 'server' => IMAP_SERVER => 'localhost' ],
[ Port => 'port' => IMAP_PORT => '993' ],
[ User => 'username' => IMAP_USER => '' ],
[ Password => 'password' => IMAP_PASSWORD => '' ],
[ Debug => 'debug' => IMAP_DEBUG => 0 ],
],
);
Lame-ass config cascade
Read from %ENV, $config, hard defaults, with different names,
write to yet more different names
Should merge with other config cascade in Config::Collect
=cut
sub get_defaults {
my( %options ) = @_;
my $result = $options{ result } || {};
$options{ defaults } ||= \%defaults; # premade defaults
( run in 0.445 second using v1.01-cache-2.11-cpan-49f99fa48dc )