Documentation
¶
Overview ¶
Command mqlite is the single-binary CLI: run a broker, or produce/consume/ administer queues against a local DB (embedded) or a remote broker (client).
Connection (read from env; the DB string is never compiled in):
MQLITE_DB=file:./mq.db | :memory: | libsql://<db>.turso.io (embedded mode)
MQLITE_DB_AUTH_TOKEN=<jwt> (remote Turso/libSQL)
MQLITE_ENDPOINT=http://host:port + MQLITE_TOKEN=<bearer> (client mode; wins if set)
MQLITE_TOKENS=mqk_a,mqk_b (tokens `serve` accepts; UNSET => a token is generated
and printed; =off disables auth — localhost/LAN only)
MQLITE_MAX_MESSAGE_BYTES=<n> (reject larger bodies)
MQLITE_SYNC=NORMAL|FULL|OFF (durability; embedded/serve)
MQLITE_DLQ_MAX_AGE=14d-ish (e.g. 336h) · MQLITE_DLQ_MAX_COUNT=1000000 · MQLITE_DLQ_RETENTION=off
(broker DLQ retention; serve)
CLI design (MQLITE-14): subcommands use the standard library `flag` package plus a small parseInterspersed helper (so flags may appear before or after positionals), with one FlagSet per command and a consistent usage/error/"ok:" style. We deliberately do NOT take a cobra/pflag dependency — for ~a dozen simple commands the stdlib is sufficient, and staying a dependency-light single binary is a goal.
Click to show internal directories.
Click to hide internal directories.