The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Clustericious::App - Clustericious app base class

VERSION

version 1.22

SYNOPSIS

 use Mojo::Base 'Clustericious::App';

DESCRIPTION

This class is the base class for all Clustericious applications. It inherits everything from Mojolicious and adds a few Clustericious specific methods documented here.

SUPER CLASS

Mojolicious

ATTRIBUTES

commands

An instance of Clustericious::Commands for use with this application.

METHODS

startup

 $app->startup;

Adds the autodata_handler plugin, common routes, and sets up logging for the client using log::log4perl.

init_logging

 $app->init_logging;

Initializing logging using ~/etc/log4perl.conf

dump_api

 my @api = $app->dump_api;

DEPRECATED: will be removed on or after January 31, 2016.

Dump out the API for this REST server.

dump_api_table

 my $api = $app->dump_api_table( $table );

DEPRECATED: will be removed on or after January 31, 2016.

Dump out the column information for the given table.

config

 my $config = $app->config;

Returns the config (an instance of Clustericious::Config) for the application.

sanity_check

 my $ok = $app->sanity_check;

This method is executed after startup, but before the application actually starts with the start command. If it returns 1 then the configuration is considered sane and the application will start. If it returns 0 then the configuration has problems and start will be aborted with an appropriate message to the user attempting start.

By default this just checks that the application's configuration file (usually located in ~/etc/MyApp.conf) is correctly formatted as either YAML or JSON.

You can override this in your application, but don't forget to call the base class's version of sanity_check before making your own checks.

SEE ALSO

Clustericious

AUTHOR

Original author: Brian Duggan

Current maintainer: Graham Ollis <plicease@cpan.org>

Contributors:

Curt Tilmes

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by NASA GSFC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.