You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tyler b396128a23 Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
.drone.yml Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
LICENSE Add license 3 years ago
README.md Initial commit 3 years ago
cache.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
go.mod Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
go.sum Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
memcache.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
memcache_test.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
memory.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
memory_test.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
redis.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago
redis_test.go Rename cache drivers, add memory driver, add tests and drone integration 3 years ago

README.md

CacheInterface

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

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.