modulepackage
0.0.0-20191011064619-b8ffeedbc98a
Repository: https://github.com/huntsman-li/go-cache.git
Documentation: pkg.go.dev
# README
go-cache
This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql
example
package main
import (
"github.com/huntsman-li/go-cache"
_ "github.com/huntsman-li/go-cache/redis"
)
func main() {
ca, err := cache.Cacher(cache.Options{
Adapter: "redis",
AdapterConfig: "addr=127.0.0.1:6379",
OccupyMode: true,
})
if err != nil {
panic(err)
}
ca.Put("liyan", "cache", 60)
}
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
Cacher is a middleware that maps a cache.Cache service into the Macaron handler chain.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewCacher creates and returns a new cacher by given adapter name and configuration.
NewFileCacher creates and returns a new file cacher.
NewMemoryCacher creates and returns a new memory cacher.
Register registers a adapter.
No description provided by the author
# Structs
FileCacher represents a file cache adapter implementation.
Item represents a cache item.
MemoryCacher represents a memory cache adapter implementation.
MemoryItem represents a memory cache item.
Options represents a struct for specifying configuration options for the cache middleware.
# Interfaces
Cache is the interface that operates the cache data.