NAME

make_kt_fixture - make fixture yaml from ktserver

VERSION

0.1

SYNOPSIS

Execute:

make_kt_fixture [--option]

Options:

-h|--host              ktserver host
-p|--port              ktserver port 
-t|--timeout           ktserver connect timeout
--db                   ktserver dbname or id
--custom-deserializer  custom-deserializer file path
-o|--output-file       output file path
-n|--namespace         only target namespace output
--help                 display this page
-v|--version           display version

DESCRIPTION

make_kt_fixture - make fixture yaml from ktserver

OPTIONS

-h|--host

ktserver host. default 127.0.0.1

-p|--port

ktserver port. default 1978

-t|--timeout

ktserver connect timeout(sec). default 1

--db

ktserver dbname or id. default 0

--custom-deserilizer

custom deserializer file path. default Storable::thaw

Custom Deserializer Example(Using JSON::XS):

# json-deserializer.pl. must be exists maybe_deseriazer
use JSON::XS;

sub maybe_deserialize {

    my $serialized = shift;
    my $deserialized;
    eval { $deserialized = JSON::XS->new->decode($serialized); };
    if ($@) {
        chomp(my $message = $@);
        warn "$message\n";
        $deserialized = $serialized;
    }
    return $deserialized;
}

# ktremotemgr
ktremotemgr set -host 127.0.0.1 key '{"nirvana":"lounge act"}'
ktremotemgr list -host 127.0.0.1 -pv
key     {"nirvana":"lounge act"}

#execute
make_kt_fixture --host 127.0.0.1 --custom-deserializer=json-deserializer.pl
---
- key: key
  value:
    nirvana: lounge act
-o|--output-file

fixture output file path. default stdout

-n|--namespace

only target namespace output. default none

--help

display help and exit

-v|--version

display version and exit

AUTHOR

holly <emperor.kurt@gmail.com>

SEE ALSO

Cache::KyotoTycoon YAML::XS

LICENSE

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