Documentation ¶
Overview ¶
Package gojavahash implements a ServerSelector for gomemcache that provides hashing that's compatible with SpyMemcached's native (e.g. java) hashing. This is based very closely on the excellent https://github.com/thatguystone/gomcketama
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JavaServerSelector ¶
type JavaServerSelector struct {
// contains filtered or unexported fields
}
JavaServerSelector implements gomemcache's ServerSelector using java hash equiv
func (*JavaServerSelector) AddServer ¶
func (ks *JavaServerSelector) AddServer(server string) error
AddServer adds a server to the ketama continuum.
func (*JavaServerSelector) Each ¶
func (ks *JavaServerSelector) Each(f func(net.Addr) error) error
Each loops through all registered servers, calling the given function.
func (*JavaServerSelector) PickServer ¶
func (ks *JavaServerSelector) PickServer(key string) (net.Addr, error)
PickServer returns the server address that a given item should be written to.
Click to show internal directories.
Click to hide internal directories.