Skip to content

sylr/go-cache

Repository files navigation

go-cache

Go Reference

sylr.dev/cache fork disclaimer

This module is a fork of github.com/patrickmn/go-cache/.

Synopsys

go-cache is an in-memory key:value store/cache similar to memcached that is suitable for applications running on a single machine.

This implementation uses go 1.18 type parameters (generics).

Its major advantage is that, being essentially a thread-safe map[string]interface{} with expiration times, it doesn't need to serialize or transmit its contents over the network.

Any object can be stored, for a given duration or forever, and the cache can be safely used by multiple goroutines.

Installation

gotip get sylr.dev/cache/v3

Reference

The API reference can be found at http://pkg.go.dev/sylr.dev/cache/v3.

Examples

See example_test.go for some usage examples.