0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-30 22:34:18 -05:00
imageproxy/cache/nop.go
Will Norris 95fdd8b79f add basic caching support
includes two implementations, a no-op NopCache and an in-memory
MemoryCache.
2013-12-04 02:55:56 -08:00

12 lines
392 B
Go

package cache
import "github.com/willnorris/go-imageproxy/data"
// NopCache provides a no-op cache implementation that doesn't actually cache anything.
var NopCache = new(nopCache)
type nopCache struct{}
func (c nopCache) Get(u string) (*data.Image, bool) { return nil, false }
func (c nopCache) Save(image *data.Image) {}
func (c nopCache) Delete(u string) {}