Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.42 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.42 KB

About

This contains implementation of the consistent hash for memcache (client available at https://github.com/bradfitz/gomemcache/). It was written using and for the Go programming language.

Using

$ go get github.com/imega/gomemcache-selector/php-memcache

Example

import (
        "github.com/bradfitz/gomemcache/memcache"
        "github.com/imega/gomemcache-selector/php-memcache"
)

func main() {
    selector := phpmemcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212")
    mc := memcache.NewFromSelector(selector)

    mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")})

    it, err := mc.Get("foo")
    ...
}

Reference