Documentation
¶
Overview ¶
Package redisguard fails Redis commands fast while Redis is unreachable. Per-command timeouts alone multiply: one request runs a dozen commands, so a blackholed Redis would still cost it seconds before every limit fails open.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrOpen = errors.New("redis unavailable (guard open)")
ErrOpen is returned without network IO while the guard is open.
Functions ¶
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard is a go-redis hook shared by every user of the client: throttles, caches and the node pool all see the same open/closed state.
func (*Guard) DialHook ¶
DialHook passes dials through: they happen inside admitted commands, whose outcome is already reported, and a probe must be able to reconnect.
func (*Guard) ProcessHook ¶
func (g *Guard) ProcessHook(next redis.ProcessHook) redis.ProcessHook
func (*Guard) ProcessPipelineHook ¶
func (g *Guard) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook