#include "lib/cache.h"
#include "lib/defines.h"
-/*
- * Defines
- */
-
-#define CACHE_DEFAULT_PATH "/tmp/kresolved"
-#define CACHE_DEFAULT_SIZE 10*(1024*1024)
-
/*
* Global bindings.
*/
static const char *help_str =
"help()\n show this help\n"
"quit()\n quit\n"
+ "modules.list()\n list modules\n"
+ "modules.load()\n load module\n"
+ "modules.unload()\n unload module\n"
+ "cache.open(path, max_size)\n open cache\n"
+ "cache.close()\n close cache\n"
;
puts(help_str);
/* No results */
"C compiler", "*all*", "*(build only)* [#]_"
"libknot_ 2.0+", "*all*", "Knot DNS library."
-There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv_` and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
+There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv`_ and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
.. csv-table::
:header: "Requirement", "Required by", "Notes"
+ "Lua_ 5.1+", "``daemon``", "Embeddable scripting language (LuaJIT_ is preferred)."
"libuv_ 1.0+", "``daemon``", "Multiplatform I/O and services."
"cmocka_", "``unit tests``", "Unit testing framework."
"Python_", "``integration tests``", "For scripting tests, C header files are required (``python-dev``)"
-Configuration reference
------------------------
\ No newline at end of file
+Daemon configuration
+--------------------
+
+The Knot DNS Resolver daemon has no traditional concept of static configuration.
+In it's simplest form it requires just a working directory in which it can set up persistent files like
+cache and the process state.
+
+.. code-block:: sh
+
+ $ kresolved /var/run/kresolved
+
+And you're good to go!
+
+Introduction
+~~~~~~~~~~~~
+
+There are several choices on how you can configure the daemon, a RPC interface a CLI or a configuration file,
+but fortunately all share a common syntax and are transparent to each other, e.g. if you change a knob, you're going to
+see it projected to other interfaces as well.
+
+.. note:: Expect this page to change a lot, as it's still just a proof of concept implementation.
+
+Configuration 101
+~~~~~~~~~~~~~~~~~
+
+If there is a `config` file in the daemon working directory, it's going to get loaded automatically, if there isn't one
+the daemon is going to start with sane defaults and listening on `localhost`. The syntax for options is like follows: ``group.option = value``
+or ``group.action(parameters)``. You can also comment using a ``--`` prefix.
+
+A simple example would be to increase the cache size.
+
+.. code-block:: lua
+
+ -- increase the cache to 100MB
+ cache.open(".", 100*1024*1024)
+
+Dynamic configuration
+~~~~~~~~~~~~~~~~~~~~~
+
+Packages and services
+~~~~~~~~~~~~~~~~~~~~~
+
+The Lua supports a concept called closures, this is extremely useful for scripting actions upon various events.
+
+.. note:: TODO, come back later!
+
+* Timers and events
+* File watchers
+* Serialization
+* Data I/O
+
$ kresolved /var/run/knot-resolver
...
[system] started in interactive mode, type 'help()'
- > module.load('cachectl')
+ > modules.load('cachectl')
> return cachectl.size()
{ "size": 53 }
\ No newline at end of file
:maxdepth: 2
build
- daemon
lib
- modules
+ daemon
config
+ modules
Indices and tables