cache
Package cache provides an in-memory LRU cache with optional TTL per entry, similar to node-cache and lru-cache in Node.js. Node equivalent: node-cache, lru-cache
import "github.com/sahilkhaire/gox/cache"
Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.
Types
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Cache | — | type | Cache is a thread-safe LRU cache with per-key TTL. |
Methods
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Cache.New | new LRUCache({ max }) | method | New creates a cache that evicts least-recently-used entries when size exceeds maxSize. |