lora_server/config/
help.rs1use super::{
4 DEFAULT_HOST, DEFAULT_PORT, HOST_ENV, PORT_ENV, SNAPSHOT_PATH_ENV, WAL_DIR_ENV,
5 WAL_SYNC_MODE_ENV,
6};
7
8pub fn help_text() -> String {
9 let version = env!("CARGO_PKG_VERSION");
10 format!(
11 "lora-server {version} — HTTP server for the Lora in-memory graph database
12
13USAGE:
14 lora-server [OPTIONS]
15
16OPTIONS:
17 --host <HOST> Bind address. Default: {DEFAULT_HOST} (or ${HOST_ENV} if set).
18 --port <PORT> TCP port. Default: {DEFAULT_PORT} (or ${PORT_ENV} if set).
19 --snapshot-path <PATH> Enable the snapshot admin surface. Mounts
20 POST /admin/snapshot/save and
21 POST /admin/snapshot/load against this file.
22 Also acts as the default target for
23 POST /admin/checkpoint when --wal-dir is set.
24 Also read from ${SNAPSHOT_PATH_ENV}.
25 --restore-from <PATH> Restore the graph from this snapshot at boot.
26 Missing file is treated as empty. When
27 --wal-dir is also set, the WAL is replayed
28 on top of the snapshot.
29 --wal-dir <DIR> Attach a write-ahead log at this directory.
30 Every mutating query is bracketed by
31 begin/commit; a crashed process recovers
32 committed writes on next boot. Read-only
33 queries do not touch the WAL.
34 Also enables the WAL admin routes
35 (POST /admin/wal/status,
36 POST /admin/wal/truncate,
37 POST /admin/checkpoint) — independent of
38 --snapshot-path. /admin/checkpoint requires
39 `path` in the request body when no
40 --snapshot-path default is configured.
41 Also read from ${WAL_DIR_ENV}.
42 --wal-sync-mode <MODE> WAL durability cadence. Only `group-sync`
43 is supported (default).
44 Also read from ${WAL_SYNC_MODE_ENV}.
45 --help Print this help and exit.
46 --version Print version and exit.
47
48ENVIRONMENT:
49 {HOST_ENV} Bind address (overridden by --host).
50 {PORT_ENV} TCP port (overridden by --port).
51 {SNAPSHOT_PATH_ENV} Path used by --snapshot-path.
52 {WAL_DIR_ENV} Directory used by --wal-dir.
53 {WAL_SYNC_MODE_ENV} Mode used by --wal-sync-mode.
54
55EXAMPLES:
56 lora-server
57 lora-server --host 0.0.0.0 --port 8080
58 lora-server --snapshot-path /var/lib/lora/graph.bin
59 lora-server --wal-dir /var/lib/lora/wal --snapshot-path /var/lib/lora/graph.bin \\
60 --restore-from /var/lib/lora/graph.bin
61"
62 )
63}
64
65pub fn version_text() -> String {
66 format!("lora-server {}", env!("CARGO_PKG_VERSION"))
67}