internal/

directory
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT

Directories

Path Synopsis
api
apitest
Package apitest provides minimal stand-ins for data commands (GET, SET, TYPE...) so the API, WebSocket and client packages can be tested before the real implementations are merged.
Package apitest provides minimal stand-ins for data commands (GET, SET, TYPE...) so the API, WebSocket and client packages can be tested before the real implementations are merged.
apiutil
Package apiutil holds what the HTTP API and the WebSocket endpoint share: RESP → JSON conversion, JSON → command parsing, and credential checks.
Package apiutil holds what the HTTP API and the WebSocket endpoint share: RESP → JSON conversion, JSON → command parsing, and credential checks.
httpapi
Package httpapi is the REST API: JSON commands, pipelines and transactions, a key browser, server stats, Prometheus metrics, the WebSocket endpoint (/v1/ws) and the dashboard (/).
Package httpapi is the REST API: JSON commands, pipelines and transactions, a key browser, server stats, Prometheus metrics, the WebSocket endpoint (/v1/ws) and the dashboard (/).
ws
Package ws serves commands over WebSocket (mounted at /v1/ws).
Package ws serves commands over WebSocket (mounted at /v1/ws).
Package auth manages users and passwords (AUTH, requirepass) and per-user permissions (ACL).
Package auth manages users and passwords (AUTH, requirepass) and per-user permissions (ACL).
Package blocking lets commands like BLPOP wait until one of their keys is written.
Package blocking lets commands like BLPOP wait until one of their keys is written.
Package cluster implements Redis Cluster style key routing with a static slot map: the keyspace is split into 16384 hash slots, each node serves a set of slot ranges, and a node answers MOVED for keys it doesn't own so cluster-aware clients learn where to send them.
Package cluster implements Redis Cluster style key routing with a static slot map: the keyspace is split into 16384 hash slots, each node serves a set of slot ranges, and a node answers MOVED for keys it doesn't own so cluster-aware clients learn where to send them.
Package command holds the command table and the dispatcher (Engine.Execute).
Package command holds the command table and the dispatcher (Engine.Execute).
Package compression compresses large string values in memory (DEFLATE, fastest level) so big cached payloads like HTML or JSON take less RAM.
Package compression compresses large string values in memory (DEFLATE, fastest level) so big cached payloads like HTML or JSON take less RAM.
Package config holds server settings.
Package config holds server settings.
consensus
raft
Package raft implements Raft leader election (the Raft paper, §5.2) to pick which cache-boy node is the replication leader.
Package raft implements Raft leader election (the Raft paper, §5.2) to pick which cache-boy node is the replication leader.
datatype
bloom
Package bloom implements a scalable Bloom filter (Almeida et al., 2007): when the newest sub-filter reaches its capacity a larger one is added with a tighter error rate, so the compound false-positive rate stays bounded by the requested one however many items are inserted.
Package bloom implements a scalable Bloom filter (Almeida et al., 2007): when the newest sub-filter reaches its capacity a larger one is added with a tighter error rate, so the compound false-positive rate stays bounded by the requested one however many items are inserted.
deque
Package deque is a growable ring buffer of strings used for Redis lists.
Package deque is a growable ring buffer of strings used for Redis lists.
hll
Package hll implements HyperLogLog cardinality estimation the way Redis does: 16384 6-bit registers indexed by a MurmurHash64A of the element, and Ertl's improved estimator ("New cardinality estimation algorithms for HyperLogLog sketches", 2017), whose standard error is about 0.81%.
Package hll implements HyperLogLog cardinality estimation the way Redis does: 16384 6-bit registers indexed by a MurmurHash64A of the element, and Ertl's improved estimator ("New cardinality estimation algorithms for HyperLogLog sketches", 2017), whose standard error is about 0.81%.
jsondoc
Package jsondoc stores a JSON document and supports a JSONPath subset:
Package jsondoc stores a JSON document and supports a JSONPath subset:
skiplist
Package skiplist implements sorted sets the same way Redis does: a skip list ordered by (score, member) for range queries, plus a hash map member→score for O(1) lookups.
Package skiplist implements sorted sets the same way Redis does: a skip list ordered by (score, member) for range queries, plus a hash map member→score for O(1) lookups.
timeseries
Package timeseries stores (timestamp, value) samples sorted by time, with optional retention and range queries with downsampling.
Package timeseries stores (timestamp, value) samples sorted by time, with optional retention and range queries with downsampling.
vector
Package vector stores embeddings by ID and answers nearest-neighbour queries.
Package vector stores embeddings by ID and answers nearest-neighbour queries.
Package eviction frees memory when maxmemory is reached.
Package eviction frees memory when maxmemory is reached.
Package expiry runs active expiration.
Package expiry runs active expiration.
feature
history
Package history keeps the last N versions of every string key (CONFIG SET history-depth N), including deletions, so old values can be read back or restored.
Package history keeps the last N versions of every string key (CONFIG SET history-depth N), including deletions, so old values can be read back or restored.
lock
Package lock implements named distributed locks with fencing tokens.
Package lock implements named distributed locks with fencing tokens.
namespace
Package namespace isolates keys of different apps/tenants sharing one server.
Package namespace isolates keys of different apps/tenants sharing one server.
queue
Package queue implements job queues with delayed jobs, a visibility timeout, retries and a dead-letter list.
Package queue implements job queues with delayed jobs, a visibility timeout, retries and a dead-letter list.
ratelimit
Package ratelimit implements GCRA (Generic Cell Rate Algorithm) rate limiting.
Package ratelimit implements GCRA (Generic Cell Rate Algorithm) rate limiting.
scripting
Package scripting runs server-side JavaScript (EVAL/EVALSHA) with goja.
Package scripting runs server-side JavaScript (EVAL/EVALSHA) with goja.
semcache
Package semcache is a semantic cache for LLM apps: it stores responses by the embedding of the prompt, and a lookup returns the cached response of the most similar earlier prompt if its cosine similarity is above a threshold.
Package semcache is a semantic cache for LLM apps: it stores responses by the embedding of the prompt, and a lookup returns the cached response of the most similar earlier prompt if its cosine similarity is above a threshold.
singleflight
Package singleflight holds the compute locks behind CACHE.GET: when a cached key is missing, only one client gets to recompute it while the others wait for the key to be written.
Package singleflight holds the compute locks behind CACHE.GET: when a cached key is missing, only one client gets to recompute it while the others wait for the key to be written.
tags
Package tags keeps a two-way index between keys and tags, so every key carrying a tag can be found (and deleted) in one call.
Package tags keeps a two-way index between keys and tags, so every key carrying a tag can be found (and deleted) in one call.
watch
Package watch streams key changes to clients (KEYWATCH) and to HTTP endpoints (webhooks).
Package watch streams key changes to clients (KEYWATCH) and to HTTP endpoints (webhooks).
Package glob implements Redis-style glob matching: * ? [abc] [^a] [a-z] and \ escapes.
Package glob implements Redis-style glob matching: * ? [abc] [^a] [a-z] and \ escapes.
Package observability collects metrics (per-command calls and latency), the slow log, and MONITOR streaming (tracing.go).
Package observability collects metrics (per-command calls and latency), the slow log, and MONITOR streaming (tracing.go).
Package persistence ties snapshots and the AOF to the engine: it loads data at startup, applies the "save" rules, runs BGSAVE / BGREWRITEAOF and flushes everything at shutdown.
Package persistence ties snapshots and the AOF to the engine: it loads data at startup, applies the "save" rules, runs BGSAVE / BGREWRITEAOF and flushes everything at shutdown.
aof
Package aof implements the append-only file: every write command is appended in RESP form (the same bytes a client sends), and replaying the file through the dispatcher rebuilds the dataset.
Package aof implements the append-only file: every write command is appended in RESP form (the same bytes a client sends), and replaying the file through the dispatcher rebuilds the dataset.
snapshot
Package snapshot implements cache-boy's binary point-in-time dump (the equivalent of Redis' RDB file).
Package snapshot implements cache-boy's binary point-in-time dump (the equivalent of Redis' RDB file).
protocol
resp
Package resp implements the Redis serialization protocol, versions 2 and 3.
Package resp implements the Redis serialization protocol, versions 2 and 3.
Package pubsub implements PUBLISH/SUBSCRIBE with exact channels and glob patterns.
Package pubsub implements PUBLISH/SUBSCRIBE with exact channels and glob patterns.
Package replication implements leader → follower replication in the style of Redis' SYNC protocol:
Package replication implements leader → follower replication in the style of Redis' SYNC protocol:
Package server accepts TCP connections and runs one goroutine per client.
Package server accepts TCP connections and runs one goroutine per client.
Package store is the keyspace: a map of key → Entry split into shards, each with its own mutex, so commands on different keys run in parallel on all CPU cores.
Package store is the keyspace: a map of key → Entry split into shards, each with its own mutex, so commands on different keys run in parallel on all CPU cores.
Package tracking implements server-assisted client-side caching (CLIENT TRACKING).
Package tracking implements server-assisted client-side caching (CLIENT TRACKING).
Package transaction implements WATCH: optimistic locking for MULTI/EXEC.
Package transaction implements WATCH: optimistic locking for MULTI/EXEC.

Jump to

Keyboard shortcuts

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