Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

HOT Cache Examples

This directory contains practical examples demonstrating how to use the HOT cache library in various scenarios.

Quick Start

Choose an example based on your needs:

Basic Examples

  • Simple LRU - Basic cache operations and LRU eviction
  • TTL Cache - Time-based expiration with jitter and background cleanup
  • Batch Operations - Performance optimization with batch operations
  • Concurrency - Thread safety and concurrent access patterns

Advanced Examples

Getting Started

  1. Clone the repository:

    git clone https://github.com/samber/hot.git
    cd hot/examples
  2. Run a basic example:

    cd basic/simple-lru
    go run simple.go
  3. Explore advanced features:

    cd ../web
    go run web-server.go

Contributing

Feel free to add new examples or improve existing ones. Each example should:

  • Be concise and readable in a few seconds
  • Include a comprehensive README
  • Demonstrate practical use cases
  • Follow Go best practices