basic

command
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 7 Imported by: 0

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

Overview

Package main demonstrates basic in-memory cache usage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL