Documentation
¶
Overview ¶
Package dragonfly provides a Dragonfly-backed cache store through its Redis protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilClient = rediscache.ErrNilClient ErrNilCodec = rediscache.ErrNilCodec )
Functions ¶
This section is empty.
Types ¶
type InvalidationBus ¶
type InvalidationBus[K comparable] struct { *rediscache.InvalidationBus[K] }
InvalidationBus distributes events through Dragonfly's Redis-compatible Pub/Sub.
func NewInvalidationBus ¶
func NewInvalidationBus[K comparable](client goredis.UniversalClient, options ...InvalidationOption[K]) (*InvalidationBus[K], error)
NewInvalidationBus constructs a Dragonfly invalidation bus.
type InvalidationOption ¶
type InvalidationOption[K comparable] func(*invalidationConfig[K]) error
InvalidationOption configures Dragonfly invalidation serialization.
func WithInvalidationKeyCodec ¶
func WithInvalidationKeyCodec[K comparable](codec cache.Codec[K]) InvalidationOption[K]
WithInvalidationKeyCodec overrides automatic invalidation-key serialization.
type Locker ¶
type Locker[K comparable] struct { *rediscache.Locker[K] }
Locker provides renewable Dragonfly leases through Redis-compatible scripts.
func NewLocker ¶
func NewLocker[K comparable](client goredis.UniversalClient, options ...LockerOption[K]) (*Locker[K], error)
NewLocker constructs a Dragonfly locker using a caller-owned Redis client.
type LockerOption ¶
type LockerOption[K comparable] func(*lockerConfig[K]) error
LockerOption configures Dragonfly lock key serialization.
func WithLockerKeyCodec ¶
func WithLockerKeyCodec[K comparable](codec cache.Codec[K]) LockerOption[K]
WithLockerKeyCodec overrides automatic lock key serialization.
type Option ¶
type Option[K comparable, V any] func(*config[K, V]) error
Option configures Dragonfly serialization.
func WithKeyCodec ¶
func WithKeyCodec[K comparable, V any](codec cache.Codec[K]) Option[K, V]
WithKeyCodec overrides automatic key serialization.
func WithValueCodec ¶
func WithValueCodec[K comparable, V any](codec cache.Codec[V]) Option[K, V]
WithValueCodec overrides automatic value serialization.
type Store ¶
type Store[K comparable, V any] struct { *rediscache.Store[K, V] }
Store is a Dragonfly cache store using Redis-compatible commands.
func New ¶
func New[K comparable, V any](client goredis.UniversalClient, options ...Option[K, V]) (*Store[K, V], error)
New constructs a Dragonfly store using a caller-owned Redis client.