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::Sereal - Sereal encoder / decoder for Kelp

SYNOPSIS

        # in config
        modules => [qw(Sereal)],
        modules_init => {
                Sereal => {
                        encoder => {
                                # encoder options
                        },
                        decoder => {
                                # decoder options
                        },
                },
        },

        # in your application
        my $encoded = $self->sereal->encode({
                type => 'structure',
                name => [qw(testing sereal)],
        });

DESCRIPTION

This is a very straightforward module that integrates the Kelp framework with the Sereal serialization protocol. See Sereal::Encoder and Sereal::Decoder for a full reference on the encoder and the decoder.

METHODS INTRODUCED TO KELP

sereal

        my $sereal_module = $kelp->sereal;

Returns the instance of this module. You can use this instance to invoke the methods listed below.

METHODS

encode

        my $encoded = $kelp->sereal->encode($data);

A shortcut to $kelp->sereal->encoder->encode

encoder

        my $encoder_instance = $kelp->sereal->encoder;

Returns the instance of Sereal::Encoder

decode

        my $decoded = $kelp->sereal->decode($sereal_string);

A shortcut to $kelp->sereal->decoder->decode

decoder

        my $decoder_instance = $kelp->sereal->decoder;

Returns the instance of Sereal::Decoder

CONFIGURATION

encoder

A hashref with all the arguments to "new" in Sereal::Encoder.

decoder

A hashref with all the arguments to "new" in Sereal::Decoder.

SEE ALSO

  • Kelp, the framework

  • Sereal, the wrapper for the encoder / decoder

AUTHOR

Bartosz Jarzyna, <bbrtj.pro@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2021 - 2022 by Bartosz Jarzyna

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