Versions in this module Expand all Collapse all v0 v0.2.0 Oct 13, 2026 Changes in this version + const DefaultRedisCompressMinBytes + const DefaultRedisDialTimeout + const DefaultRedisKeyPrefix + const DefaultRedisMaxValueBytes + const DefaultRedisPendingMax + const DefaultRedisTimeout + const DefaultRedisVersionTTL + const RedisCluster + const RedisSentinel + const RedisStandalone + var ErrForeignDependency = errors.New("cache: dependency names another tenant") type Cache + InvalidateTenant func(ctx context.Context, id tenant.ID) error + Lookup func(ctx context.Context, id tenant.ID, sha string, deps []Namespace) (Entry, Snapshot, error) + type Entry struct + TTL time.Duration + Value []byte type LocalCache + func (l *LocalCache) InvalidateTenant(_ context.Context, id tenant.ID) error + func (l *LocalCache) Lookup(_ context.Context, id tenant.ID, sha string, deps []Namespace) (Entry, Snapshot, error) + func (l *LocalCache) Prune(served func(tenant.ID) bool) type Namespace + Tenant tenant.ID + type RedisCache struct + func NewRedis(cfg RedisConfig) (*RedisCache, error) + func (r *RedisCache) Close() error + func (r *RedisCache) Invalidate(ctx context.Context, namespaces []Namespace) (uint64, error) + func (r *RedisCache) InvalidateTenant(ctx context.Context, id tenant.ID) error + func (r *RedisCache) Lookup(ctx context.Context, id tenant.ID, sha string, deps []Namespace) (Entry, Snapshot, error) + func (r *RedisCache) Set(ctx context.Context, snap Snapshot, value []byte, ttl time.Duration) error + type RedisConfig struct + Addrs []string + BreakerOpenFor time.Duration + BreakerThreshold int + CompressMinBytes int + DB int + DialTimeout time.Duration + KeyPrefix string + MaxValueBytes int + Mode string + Password string + PendingMax int + SentinelMaster string + TLS *tls.Config + Timeout time.Duration + Username string + VersionTTL time.Duration + type Snapshot struct type VersionManager + func (vm *VersionManager) BumpTenant(id tenant.ID) + func (vm *VersionManager) Prune(keep func(tenant.ID) bool) v0.1.0 Aug 19, 2026 Changes in this version + func QueryTimeToTTL(queryTime time.Duration) time.Duration + type Cache interface + Close func() error + Get func(ctx context.Context, sha string, deps []Namespace) ([]byte, time.Duration, error) + Invalidate func(ctx context.Context, namespaces []Namespace) (uint64, error) + Set func(ctx context.Context, sha string, deps []Namespace, value []byte, ...) error + type LocalCache struct + func NewLocal(maxCost int64) (*LocalCache, error) + func (l *LocalCache) Close() error + func (l *LocalCache) Get(_ context.Context, sha string, deps []Namespace) ([]byte, time.Duration, error) + func (l *LocalCache) Invalidate(_ context.Context, namespaces []Namespace) (uint64, error) + func (l *LocalCache) Set(_ context.Context, sha string, deps []Namespace, value []byte, ...) error + func (l *LocalCache) Wait() + type Namespace struct + Scope string + Table string + type VersionManager struct + func NewVersionManager(conn *nats.Conn) *VersionManager + func (vm *VersionManager) BumpNamespace(table, scope string) + func (vm *VersionManager) BumpTable(table string) + func (vm *VersionManager) NamespaceKey(table, scope string) string + func (vm *VersionManager) QueryKey(sha string, deps []Namespace) string