Convos::Core::Backend::File - Backend for storing object to file
DESCRIPTION
Convos::Core::Backend::File contains methods which is useful for objects that want to be persisted to disk or store state to disk.
Where is data stored
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:
$HOME/.local/share/convos/
$HOME
is figured out from "my_home" in File::HomeDir.
Directory structure
$CONVOS_HOME/
$CONVOS_HOME/[email protected]/ # one directory per user
$CONVOS_HOME/[email protected]/user.json # user settings
$CONVOS_HOME/[email protected]/irc-libera/connection.json # connection settings
$CONVOS_HOME/[email protected]/irc-libera/2015/02.log # connection log
$CONVOS_HOME/[email protected]/irc-libera/2015/10/marcus.log # conversation log
$CONVOS_HOME/[email protected]/irc-libera/2015/12/#convos.log # conversation 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 conversation thread. Ex: all conversations with "marcus".
Hard to search for messages between connections for a given date.
ATTRIBUTES
Convos::Core::Backend::File inherits all attributes from Convos::Core::Backend and implements the following new ones.
home
METHODS
Convos::Core::Backend::File inherits all methods from Convos::Core::Backend and implements the following new ones.
connections_p
See "connections_p" in Convos::Core::Backend.
delete_messages_p
See "delete_messages_p" in Convos::Core::Backend.
delete_object_p
See "delete_object_p" in Convos::Core::Backend.
files_p
See "files_p" in Convos::Core::Backend.
load_object_p
See "load_object_p" in Convos::Core::Backend.
messages_p
See "messages_p" in Convos::Core::Backend.
notifications_p
See "notifications_p" in Convos::Core::Backend.
save_object_p
See "save_object_p" in Convos::Core::Backend.
users_p
See "users_p" in Convos::Core::Backend.