Documentation ¶
Overview ¶
depend on github.com/bradfitz/gomemcache/memcache
go install github.com/bradfitz/gomemcache/memcache
Usage: import(
_ "github.com/bhojpur/web/cache/memcache" "github.com/bhojpur/web/cache"
)
bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)
Index ¶
- func NewMemCache() cache.Cache
- type Cache
- func (rc *Cache) ClearAll(context.Context) error
- func (rc *Cache) Decr(ctx context.Context, key string) error
- func (rc *Cache) Delete(ctx context.Context, key string) error
- func (rc *Cache) Get(ctx context.Context, key string) (interface{}, error)
- func (rc *Cache) GetMulti(ctx context.Context, keys []string) ([]interface{}, error)
- func (rc *Cache) Incr(ctx context.Context, key string) error
- func (rc *Cache) IsExist(ctx context.Context, key string) (bool, error)
- func (rc *Cache) Put(ctx context.Context, key string, val interface{}, timeout time.Duration) error
- func (rc *Cache) StartAndGC(config string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache Memcache adapter.
func (*Cache) StartAndGC ¶
StartAndGC starts the memcache adapter. config: must be in the format {"conn":"connection info"}. If an error occurs during connecting, an error is returned
Click to show internal directories.
Click to hide internal directories.