Go to file
Tyler 3e6d1a1cc2
continuous-integration/drone/push Build is passing Details
Use proper header sizes in readme, add build status badge
2019-10-05 16:58:36 -04:00
.drone.yml Remove server dependencies as Drone does not support services 2019-10-02 20:36:45 -04:00
.gitignore Add LRU cache 2019-10-05 16:56:24 -04:00
LICENSE Add license 2019-10-02 18:08:31 -04:00
README.md Use proper header sizes in readme, add build status badge 2019-10-05 16:58:36 -04:00
cache.go Add LRU cache 2019-10-05 16:56:24 -04:00
go.mod Add LRU cache 2019-10-05 16:56:24 -04:00
go.sum Add LRU cache 2019-10-05 16:56:24 -04:00
lru.go Add LRU cache 2019-10-05 16:56:24 -04:00
lru_test.go Add LRU cache 2019-10-05 16:56:24 -04:00
memcache.go Remove server dependencies as Drone does not support services 2019-10-02 20:36:45 -04:00
memcache_test.go Remove server dependencies as Drone does not support services 2019-10-02 20:36:45 -04:00
memory.go Add LRU cache 2019-10-05 16:56:24 -04:00
memory_test.go Better test coverage for memory cache 2019-10-05 16:47:03 -04:00
redis.go Rename cache drivers, add memory driver, add tests and drone integration 2019-10-02 20:17:34 -04:00
redis_test.go Remove server dependencies as Drone does not support services 2019-10-02 20:36:45 -04:00

README.md

CacheInterface

Build Status

An experimental interface to use different caches interchangeably via URIs

Example Cache URIs:

redis://server:port?db=0&password=test
memcache://server1:11211,server2:11211
memory://
lru://?size=128

Code

The CacheInterface interface has all methods. All clients will implement this on a best-effort basis.

type CacheInterface interface {
	Has(key string) bool
	Get(key string) ([]byte, error)
	Set(key string, val interface{}, ttl time.Duration) (err error)
	Del(key string) error
}

Note: Set will automatically attempt to store byte arrays and strings directly, and encode the rest with JSON.