Application variables filesystem
So far it's a python library, based on fusepy library, that allows you to expose whatever value you want from your app, tipically metrics or config values, as files in a directory.
Files can be read-only or read-write(able).
-
See requirements.txt for required libraries.
-
Check main.py for a working example.
VarsFS(mountpoint)
Takes only one argument; the fullpath to the mount point. Returns a new instance of VarsFS.
Creates a "file" named as the value of varname
into mountpoint
.
Read operations will call the getter_fn
and write operations will call setter_fn
.
getter_fn must be declared so to receive one argument (the variable name)
def some_getter(varname):
...
setter_fn must be declared so to receive two arguments (the variable name and the value to be assigned)
def some_setter(varname, data):
...
Starts the file system. If foreground
is set to False, will start the filesystem on a separated thread,
otherwise will block execution.