Dancer2::Plugin::Etcd
get '/foo/:name' => sub { $tokens = shift; $etcd = etcd('foo'); $name = param('name'); $tokens->{name} = $etcd->range({ key => $name })->get_value; [ ... ] }; # save development configs to etcd shepherd put # retrieve latest version of configs shepherd get
The etcd keyword which is exported by this plugin allows you to connect directly to etcd v3 api.
etcd
By far the most interesting part of this module is shepherd. shepherd allows you to save Dancer App YAML configs to etcd by line as key/value. Even more interesting is that it maintains your comments. An example of usage would be spawning a container with the application then simply running shepherd get --env=production would bring in the latest production configs for your app.
single e.g.:
plugins: Etcd: host: 127.0.0.1 port: 4001 user: samb password: h3xFu5ion ssl: 1
named e.g.:
plugins: Etcd: connections: foo: host: 127.0.0.1 port: 4001 user: samb password: h3xFu5ion bar: host: 127.0.0.1 port: 2379
default 127.0.0.1
default 2379
Etcd username.
Etcd user password.
Secure connection is recommended,
Sam Batschelet, <sbatschelet at mac.com>
The Dancer2 developers and community for their great application framework and for their quick and competent support.
Copyright 2016 Sam Batschelet (hexfusion).
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Dancer2::Plugin::Etcd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Plugin::Etcd
CPAN shell
perl -MCPAN -e shell install Dancer2::Plugin::Etcd
For more information on module installation, please visit the detailed CPAN module installation guide.