robscc / lrucache

Light-weight in-memory LRU (object) cache library for Go

Home Page:godoc.org/github.com/hraban/lrucache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LRUCACHE

Lrucache is a powerful key/value store for Go.

You can use it almost the same way as an in-memory dictionary (map[string]interface{}) but there are many important differences in implementation.

Features

map[string]interface{} lrucache
thread-safe no yes
maximum size no yes
OnMiss handler no yes
  • purges least recently used element when full
  • elements can report their own size
  • everything is cacheable (interface{})
  • is a front for your persistent storage (S3, disk, ...) by using OnMiss hooks

Examples and API are on godoc:

http://godoc.org/github.com/hraban/lrucache

The licensing terms are described in the file LICENSE.

About

Light-weight in-memory LRU (object) cache library for Go

godoc.org/github.com/hraban/lrucache

License:MIT License


Languages

Language:Go 100.0%