Documentation
¶
Index ¶
- func New(opts ...cache.Option) (cache.RawCache, error)
- type Cache
- func (vc *Cache) Close() error
- func (vc *Cache) Decrement(ctx context.Context, key string, delta int64) (int64, error)
- func (vc *Cache) Delete(_ context.Context, key string) error
- func (vc *Cache) Exists(_ context.Context, key string) (bool, error)
- func (vc *Cache) Expire(_ context.Context, _ string, _ time.Duration) error
- func (vc *Cache) Flush(_ context.Context) error
- func (vc *Cache) Get(_ context.Context, key string) ([]byte, bool, error)
- func (vc *Cache) Increment(_ context.Context, key string, delta int64) (int64, error)
- func (vc *Cache) Set(_ context.Context, key string, value []byte, _ time.Duration) error
- func (vc *Cache) SupportsPerKeyTTL() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a JetStream-backed cache implementation using the NATS KeyValue store.
func (*Cache) Expire ¶ added in v1.73.0
Expire updates the TTL of an existing key. JetStream KV TTL is configured at bucket level, so per-key TTL changes are not supported.
func (*Cache) SupportsPerKeyTTL ¶ added in v1.73.0
Click to show internal directories.
Click to hide internal directories.