Convos::Core::Backend::File - Backend for storing object to file
Convos::Core::Backend::File contains methods which is useful for objects that want to be persisted to disk or store state to disk.
CONVOS_HOME can be set to specify the root location for where to save data from objects. The default directory on *nix systems is something like this:
CONVOS_HOME
$HOME/.local/share/convos/
$HOME is figured out from "my_home" in File::HomeDir.
$HOME
$CONVOS_HOME/ $CONVOS_HOME/joe@example.com/ # one directory per user $CONVOS_HOME/joe@example.com/user.json # user settings $CONVOS_HOME/joe@example.com/irc-freenode/connection.json # connection settings $CONVOS_HOME/joe@example.com/irc-freenode/2015/02.log # connection log $CONVOS_HOME/joe@example.com/irc-freenode/2015/10/marcus.log # dialog log $CONVOS_HOME/joe@example.com/irc-freenode/2015/12/#convos.log # dialog log
Notes about the structure:
Easy to delete a user and all associated data.
Easy to delete a connection and all associated data.
One log file per month should not cause too big files.
Hard to delete a dialog thread. Ex: all dialogs with "marcus".
Hard to search for messages between connections for a given date.
Convos::Core::Backend::File inherits all attributes from Convos::Core::Backend and implements the following new ones.
See "home" in Convos::Core.
Convos::Core::Backend::File inherits all methods from Convos::Core::Backend and implements the following new ones.
See "connections" in Convos::Core::Backend.
See "delete_object" in Convos::Core::Backend.
See "load_object" in Convos::Core::Backend.
See "messages" in Convos::Core::Backend.
See "notifications" in Convos::Core::Backend.
See "save_object" in Convos::Core::Backend.
See "users" in Convos::Core::Backend.
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Convos, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Convos
CPAN shell
perl -MCPAN -e shell install Convos
For more information on module installation, please visit the detailed CPAN module installation guide.