gomemcache-selector

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2021 License: Apache-2.0

README

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

Directories

Path Synopsis
Memcache consistent hash portable for Go see: memcache_consistent_hash.c https://github.com/php/pecl-caching-memcache/blob/master/memcache_consistent_hash.c
Memcache consistent hash portable for Go see: memcache_consistent_hash.c https://github.com/php/pecl-caching-memcache/blob/master/memcache_consistent_hash.c

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL