Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(duration string, storage Storage, handler func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
Middleware is the cache interface for http requests
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache mecanism for caching strings in memory
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
NewMemoryCache creates a new in memory storage
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache storage mecanism for caching strings in memory
func NewRedisCache ¶
func NewRedisCache(url string) (*RedisCache, error)
NewRedisCache creates a new redis storage
Click to show internal directories.
Click to hide internal directories.