nova-redis

command
v1.2.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 33 Imported by: 0

README

nova-redis

What it is

nova-redis: run a local Redis store, and keep short-lived named values in it

Why use it

Keep short-lived scratch data between commands.

Install

go install github.com/mas-bandwidth/nova-tools/cmd/nova-redis@latest
nova-redis version

First run

The transcript below is executed line for line by the docs tests; the full record is in docs/TESTS.md.

No fixture and no instance: the lines below are refusals spill and fn load make BEFORE they dial anything, so they read the same on every bench. cmd/nova-redis/firstrun_test.go runs each $ line and compares the output. A write with no owner, or with no TTL, is refused and nothing is stored; the round trip against an instance (spill, recall, and recall refusing an expired key under a controlled clock) is in cmd/nova-redis/spill_test.go over a miniredis fake. fn load and fn check on a store are in cmd/nova-redis/fn_test.go over a fake and, against a throwaway redis-server, in cmd/nova-redis/fn_functional_test.go.

$ nova-redis spill --addr 127.0.0.1:6379 --name note --ttl 10m --value hi
SPILL REFUSED: --owner is required and may not be empty or hold ':' or whitespace; every key carries an owner prefix; run: nova-redis help

$ nova-redis spill --addr 127.0.0.1:6379 --owner ada --name note --ttl 0s --value hi
SPILL REFUSED: --ttl is required and must be above zero; an unbounded key is a bug; run: nova-redis help

$ nova-redis fn load
FN-LOAD REFUSED: --addr is required: the store's address as <host:port>, such as 127.0.0.1:6379 (no default); refusing to guess; run: nova-redis help

Verbs

The nova-redis section of the command reference documents every verb's flags, effect and exit codes.

  • serve
  • spill
  • recall
  • fn
  • acl
  • version
  • help

Spec

The contract is docs/SPEC-REDIS.md.

Documentation

Overview

Command nova-redis is the Layer 2 binary of docs/SPEC-REDIS.md, the owner of the local instance: `serve` launches it bound to loopback and the tailnet, with auth from nova-secrets and the fleet store's rules: AOF on, no eviction, no TTL policy, the store in --dir (serve.go). It also carries the scratch verbs: `spill` writes a value under an owner prefix with a required TTL, and `recall` reads it back and refuses a missing or expired key. A write with no owner or no TTL is refused before the instance is dialled, so an unbounded key never reaches Redis (the spill and recall section of the spec). The fn verbs load and check the store's function library (fn.go, over pkg/redisfn).

Scratch is scratch: nothing spilled is a record, and recall is allowed to miss. The password comes from the environment (NOVA_REDIS_PASSWORD, or the variable --password-env names, which a bench fills from nova-secrets at run time), never from an argument.

Every verb that dials a store (spill, recall, fn load, fn check) opens it through pkg/redisconn, the one way a nova tool opens its Redis connection (connect): one dial, the handshake and the login bounded by redisconn.OpenTimeout, no retry, and go-redis's own log kept off stderr. A store that cannot be reached or a login it refuses exits 2.

The dispatch, the banner, the help, the version verb, the refusals and the output envelope are pkg/tool's. spill and recall return a tool.Out; serve, fn and acl print their own lines (a stream, or a line the skeleton cannot render) behind a Prints verb.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL