Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Clear(ctx context.Context) error
- func (c *Cache) Close() error
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) Flush(ctx context.Context)
- func (c *Cache) Get(ctx context.Context, key string, value any) (bool, error)
- func (c *Cache) GetMulti(ctx context.Context, keys []string) (map[string]any, error)
- func (c *Cache) Keys(ctx context.Context) []string
- func (c *Cache) Set(ctx context.Context, key string, value any, ttl ...time.Duration) error
- func (c *Cache) SetMulti(ctx context.Context, items map[string]any, ttl ...time.Duration) error
- type RistrettoStore
- func (s *RistrettoStore) Close()
- func (s *RistrettoStore) Delete(ctx context.Context, key string)
- func (s *RistrettoStore) Flush(ctx context.Context)
- func (s *RistrettoStore) Get(ctx context.Context, key string) (*models.Entry, bool)
- func (s *RistrettoStore) GetMulti(ctx context.Context, keys []string) map[string]any
- func (s *RistrettoStore) Set(ctx context.Context, key string, entry *models.Entry) error
- func (s *RistrettoStore) SetMulti(ctx context.Context, items map[string]any, ttl time.Duration) error
- type Store
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache combines cache operations with key tracking.
type RistrettoStore ¶
type RistrettoStore struct {
// contains filtered or unexported fields
}
RistrettoStore implements the Store interface using Ristretto.
func (*RistrettoStore) Delete ¶
func (s *RistrettoStore) Delete(ctx context.Context, key string)
Delete removes a cache entry.
func (*RistrettoStore) Flush ¶
func (s *RistrettoStore) Flush(ctx context.Context)
Flush clears the entire cache.
type Store ¶
type Store interface { Set(ctx context.Context, key string, entry *models.Entry) error Get(ctx context.Context, key string) (*models.Entry, bool) Delete(ctx context.Context, key string) Flush(ctx context.Context) Close() GetMulti(ctx context.Context, keys []string) map[string]any SetMulti(ctx context.Context, items map[string]any, ttl time.Duration) error }
Store defines the interface for cache operations.
Click to show internal directories.
Click to hide internal directories.