Documentation
¶
Overview ¶
Package valkey wraps a go-redis client used to share ephemeral server state across replicas (forge OAuth/CSRF state, board-MCP run tokens, auth rate-limit buckets). It supports a Sentinel-HA failover topology (the cloud posture) and a single-node URL (dev/local). The store implementations in pkg/server use the returned client directly; this package only owns construction + health.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin handle over a go-redis universal client.
func New ¶
New builds a client. Sentinel HA when SentinelAddrs is set; otherwise a single-node client from URL. Errors when neither is configured.
func (*Client) Redis ¶
func (c *Client) Redis() redis.UniversalClient
Redis returns the underlying client for the store implementations.
type Options ¶
type Options struct {
// URL is a single-node connection string (redis://[:pass@]host:port[/db]).
URL string
// SentinelAddrs is the sentinel endpoint list for HA failover mode.
SentinelAddrs []string
// MasterName is the Sentinel-monitored master (required with SentinelAddrs).
MasterName string
// Password authenticates to the data nodes.
Password string
// SentinelPassword authenticates to the sentinels (defaults to Password).
SentinelPassword string
}
Options configures the client. Sentinel mode wins when SentinelAddrs is set.