package
0.0.0-20241123141403-e7b9dc6866d0
Repository: https://github.com/unix-world/smartgoext.git
Documentation: pkg.go.dev
# README
About
This is a memcache client library for the Go programming language (http://golang.org/).
Example
Install with:
$ go get github.com/bradfitz/gomemcache/memcache
Then use it like:
import (
"github.com/bradfitz/gomemcache/memcache"
)
func main() {
mc := memcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212")
mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")})
it, err := mc.Get("foo")
...
}
Full docs, see:
See https://pkg.go.dev/github.com/bradfitz/gomemcache/memcache
Or run:
$ godoc github.com/bradfitz/gomemcache/memcache
# Functions
New returns a memcache client using the provided server(s) with equal weight.
NewFromSelector returns a new Client using the provided ServerSelector.
# Constants
DefaultMaxIdleConns is the default maximum number of idle connections kept for any single address.
DefaultTimeout is the default socket read/write timeout.
# Variables
ErrCacheMiss means that a Get failed because the item wasn't present.
ErrCASConflict means that a CompareAndSwap call failed due to the cached value being modified between the Get and the CompareAndSwap.
ErrMalformedKey is returned when an invalid key is used.
ErrNoServers is returned when no servers are configured or available.
ErrNoStats means that no statistics were available.
ErrNotStored means that a conditional write operation (i.e.
ErrServer means that a server error occurred.
# Structs
Client is a memcache client.
ConnectTimeoutError is the error type used when it takes too long to connect to the desired host.
Item is an item to be got or stored in a memcached server.
ServerList is a simple ServerSelector.
# Interfaces
ServerSelector is the interface that selects a memcache server as a function of the item's key.