NAME

Yancy::Util - Utilities for Yancy

VERSION

version 1.011

SYNOPSIS

    use Yancy::Util qw( load_backend );
    my $be = load_backend( 'test://localhost', $collections );

DESCRIPTION

This module contains utility functions for Yancy.

SUBROUTINES

load_backend

    my $backend = load_backend( $backend_url, $collections );
    my $backend = load_backend( { $backend_name => $arg }, $collections );

Get a Yancy backend from the given backend URL, or from a hash reference with a backend name and optional argument. The $collections hash is the configured collections for this backend.

A backend URL should begin with a name followed by a colon. The first letter of the name will be capitalized, and used to build a class name in the Yancy::Backend namespace.

The $backend_name should be the name of a module in the Yancy::Backend namespace. The $arg is handled by the backend module. Read your backend module's documentation for details.

See "Database Backend" in Yancy for information about backend URLs and Yancy::Backend for more information about backend objects.

SEE ALSO

Yancy

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Doug Bell.

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