The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Cerberus::Plugin - A base class for App::Cerberus plugins

VERSION

version 0.11

DESCRIPTION

If you want to write a plugin for App::Cerberus then you must provide a request method, which accepts a Plack::Request object as its first argument, and a \%response hashref as its second.

package App::Cerberus::Plugin::Foo;

use parent 'App::Cerberus::Plugin';

sub request {
    my ($self, $request, $response) = @_;

    $response->{foo} = {.....};

}

Optionally, you can also add an init method, which will be called with any options that were specified in the config file:

sub init {
    my ($self,@args) = @_;
    ...
}

AUTHOR

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Clinton Gormley.

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