Documentation
¶
Index ¶
- type Adapter
- func (a *Adapter) Clear()
- func (a *Adapter) Close() error
- func (a *Adapter) CompareAndSwap(key string, old, new any) bool
- func (a *Adapter) Delete(key string)
- func (a *Adapter) Get(key string) (any, bool)
- func (a *Adapter) LoadAndDelete(key string) (any, bool)
- func (a *Adapter) Range(fn func(key string, value any) bool)
- func (a *Adapter) Set(key string, value any, cost int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is an unbounded L1 cache backed by sync.Map.
This is the default L1 adapter used when no custom adapter is configured. It offers excellent performance under read-heavy workloads but provides no eviction, no size limits, and no cost awareness.
For production services with memory constraints, consider a bounded adapter backed by Ristretto, Theine, or Otter.
Click to show internal directories.
Click to hide internal directories.