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

Kelp::Module::Whelk - Whelk as a Kelp module

SYNOPSIS

        # in Kelp configuration
        {
                modules => [qw(Whelk)],
                modules_init => {
                        Whelk => {
                                resources => {
                                        MyResource => '/',
                                },

                                # rest of the normal Whelk configuration
                                ...
                        },
                },
        }

DESCRIPTION

Whelk module is a Kelp module which implements Whelk. If is used by default by the standalone Whelk module and can be used explicitly in a Kelp application to add Whelk API to it.

See Whelk::Manual::Kelp for details on how to use Whelk in existing Kelp applications. There is no need to interact with this module in standalone applications.

METHODS ADDED TO KELP

This module just adds a single method to the Kelp application, whelk, which returns instance of this module.

ATTRIBUTES

These attributes are generated by the module as a result of looking at the config. Most of those will not be available before "finalize" is called.

config

Whelk-specific configuration as the module sees it.

inhale_response

Whether to inhale response before exhaling it.

openapi_generator

Instance of Whelk::OpenAPI or other class used to generate the OpenAPI document.

resources

Metadata for Whelk resources in form of a hashref.

endpoints

An array reference of all endpoint instances created by add_endpoint calls.

METHODS

finalize

        $self->whelk->finalize;

Finalizes the API by calling all resources, installing their endpoints and installing the OpenAPI endpoint. Must be called explicitly in application's build method.