Documentation
¶
Overview ¶
Package redis provides a Redis-backed gateway.Coordinator, for sharing certificate issuance arbitration and distribution across every process in a deployment. It is a separate package specifically so that importing the root gateway package never pulls in github.com/redis/go-redis/v9 for applications that do not want it (e.g. those using the default gateway.MemoryCoordinator, or a different Coordinator entirely).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator is a gateway.Coordinator backed by a Redis client: Put/Get use plain SET/GET with the given TTL, and TryLock uses SET NX PX for acquisition and the Lua script above for release - a real mutual exclusion primitive, unlike a best-effort distributed lock.
func New ¶
func New(client goredis.Cmdable, opts ...Option) *Coordinator
New creates a Coordinator backed by client. client may be a *redis.Client, *redis.ClusterClient, or any other goredis.Cmdable implementation.
type Option ¶
type Option func(*Coordinator)
Option configures a Coordinator created with New.
func WithKeyPrefix ¶
WithKeyPrefix namespaces every key this Coordinator reads or writes, so multiple gateway deployments (or unrelated applications) can share one Redis instance/database without colliding. Defaults to no prefix.