package
Version:
v0.22.2
Opens a new window with list of versions in this module.
Published: Apr 14, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Cachego - Memcached driver
The drivers uses gomemcache to store the cache data.
Usage
package main
import (
"log"
"time"
"github.com/bradfitz/gomemcache/memcache"
"github.com/faabiosr/cachego/memcached"
)
func main() {
cache := memcached.New(
memcache.New("localhost:11211"),
)
if err := cache.Save("user_id", "1", 10*time.Second); err != nil {
log.Fatal(err)
}
id, err := cache.Fetch("user_id")
if err != nil {
log.Fatal(err)
}
log.Printf("user id: %s \n", id)
}
Documentation
¶
Package memcached providers a cache driver that stores the cache in Memcached.
New creates an instance of Memcached cache driver
Source Files
¶
Click to show internal directories.
Click to hide internal directories.