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.
Gusted 91ca4a8fa8
continuous-integration/drone/push Build is passing Details
Use blake2b as hash algorithm (#14)
4 months ago
ledis Make linter happy (#13) 4 months ago
memcache Give each implementation it's own package (#11) 5 months ago
mysql Use blake2b as hash algorithm (#14) 4 months ago
nodb Make linter happy (#13) 4 months ago
postgres Use blake2b as hash algorithm (#14) 4 months ago
redis Give each implementation it's own package (#11) 5 months ago
.drone.yml Rework tests & ci pipeline (#6) 5 months ago
.gitignore Rework tests & ci pipeline (#6) 5 months ago
LICENSE Initial commit 8 years ago
README.md Update project aim and description (#10) 5 months ago
cache.go Update project aim and description (#10) 5 months ago
cache_test.go Rework tests & ci pipeline (#6) 5 months ago
file.go Use blake2b as hash algorithm (#14) 4 months ago
file_test.go Rework tests & ci pipeline (#6) 5 months ago
go.mod Use blake2b as hash algorithm (#14) 4 months ago
go.sum Use blake2b as hash algorithm (#14) 4 months ago
memory.go Make linter happy (#13) 4 months ago
memory_test.go Add Ping to Interface (#4) 5 months ago
utils.go Make linter happy (#13) 4 months ago

README.md

cache

cache is a middleware that aim to have a transparent interface for a lot of cache implementations.

Use use many cache adapters, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Ledis and Nodb.

Installation

go get gitea.com/go-chi/cache

Getting Help

// Cache is the interface that operates the cache data.
type Cache interface {
	// Put puts value into cache with key and expire time.
	Put(key string, val interface{}, timeout int64) error
	// Get gets cached value by given key.
	Get(key string) interface{}
	// Delete deletes cached value by given key.
	Delete(key string) error
	// Incr increases cached int-type value by given key as a counter.
	Incr(key string) error
	// Decr decreases cached int-type value by given key as a counter.
	Decr(key string) error
	// IsExist returns true if cached value exists.
	IsExist(key string) bool
	// Flush deletes all cached data.
	Flush() error
	// StartAndGC starts GC routine based on config string settings.
	StartAndGC(opt Options) error
	// Ping tests if the cache is alive
	Ping() error
}

Credits

This package is a modified version of go-macaron/cache.

License

This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.