redis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package redis builds the cache client.

The cache is strictly optional. Redis runs with no persistence and an LRU eviction policy, so any key may vanish at any moment; nothing correctness-critical may be stored here. Every call site must treat a Redis error as a cache miss and fall through to Postgres, and readiness reports a Redis outage as degraded rather than unready — failing readiness would take a working site out of rotation over a cache problem.

Index

Constants

View Source
const PingTimeout = 750 * time.Millisecond

PingTimeout is the budget for a readiness probe's cache check.

Generous, and deliberately not the number that decides a stall: ReadTimeout caps every command under it, so a Redis that accepts and never answers is reported degraded in REDIS_READ_TIMEOUT rather than in this. What this bounds is the rest — acquiring a connection, dialling one, retrying — on a probe that must answer whatever the cache is doing.

Variables

This section is empty.

Functions

func Open

func Open(ctx context.Context, c config.Config) (*redis.Client, error)

Open creates the client and verifies connectivity.

A failure to connect is returned so startup can log it, but the caller is expected to continue: the service is fully functional without a cache, only slower.

Types

type Client

type Client = redis.Client

Jump to

Keyboard shortcuts

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