Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + var ErrInvalidationPayloadTooLarge = errors.New("cache postgres: invalidation payload exceeds PostgreSQL notification limit") + var ErrNilCodec = errors.New("cache postgres: codec must not be nil") + var ErrNilPool = errors.New("cache postgres: pool must not be nil") + type InvalidationBus struct + func NewInvalidationBus[K comparable](pool *pgxpool.Pool, options ...InvalidationOption[K]) (*InvalidationBus[K], error) + func (b *InvalidationBus[K]) Publish(ctx context.Context, event cache.InvalidationEvent[K]) error + func (b *InvalidationBus[K]) Subscribe(ctx context.Context, namespace string, handler cache.InvalidationHandler[K]) error + type InvalidationOption func(*invalidationConfig[K]) error + func WithInvalidationKeyCodec[K comparable](codec cache.Codec[K]) InvalidationOption[K] + type Locker struct + func NewLocker[K comparable](pool *pgxpool.Pool, options ...LockerOption[K]) (*Locker[K], error) + func (l *Locker[K]) Lock(ctx context.Context, namespace string, key K, ttl time.Duration) (cache.Lease, error) + type LockerOption func(*lockerConfig[K]) error + func WithLockerKeyCodec[K comparable](codec cache.Codec[K]) LockerOption[K] + type Option func(*config[K, V]) error + func WithKeyCodec[K comparable, V any](codec cache.Codec[K]) Option[K, V] + func WithValueCodec[K comparable, V any](codec cache.Codec[V]) Option[K, V] + type Store struct + func New[K comparable, V any](pool *pgxpool.Pool, options ...Option[K, V]) (*Store[K, V], error) + func (s *Store[K, V]) DeleteExpired(ctx context.Context) (int64, error) + func (s *Store[K, V]) Get(ctx context.Context, namespace string, key K) (cache.Entry[V], bool, error) + func (s *Store[K, V]) Invalidate(ctx context.Context, namespace string, key K) error + func (s *Store[K, V]) InvalidateAll(ctx context.Context, namespace string) (returnErr error) + func (s *Store[K, V]) Migrate(ctx context.Context) error + func (s *Store[K, V]) Set(ctx context.Context, namespace string, key K, entry cache.Entry[V]) (returnErr error)