command
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Feb 18, 2026
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Basic Cache Example
Demonstrates the core Cache[T] API using an in-memory (Ristretto) store.
What it shows
- Creating a
memory.Store with a max-cost limit
- Wrapping it in a type-safe
Cache[User] with a default TTL
Set, Get, Delete, and Clear operations
- Handling
ErrNotFound on a cache miss
Run
go run ./examples/basic/
Documentation
¶
Package main demonstrates basic in-memory cache usage.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.