cluster

package
v0.0.0-...-0444a71 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VirtualServers = 32
)

Variables

This section is empty.

Functions

func BKDRHash

func BKDRHash(s []byte) uint32

func MD5Hash

func MD5Hash(s []byte) uint32

Types

type Cluster

type Cluster interface {
	Add(server string, por int) error
	Set(server ...string) error
	Get(key []byte) *gmemcached.GMConnection
	List() []*gmemcached.GMConnection
}

func New

type ConnectionHash

type ConnectionHash struct {
	// contains filtered or unexported fields
}

type ConsistentHashSL

type ConsistentHashSL struct {
	// contains filtered or unexported fields
}

func (*ConsistentHashSL) Add

func (C *ConsistentHashSL) Add(server string, port int) error

func (*ConsistentHashSL) Get

func (*ConsistentHashSL) Len

func (C *ConsistentHashSL) Len() int

func (*ConsistentHashSL) Less

func (C *ConsistentHashSL) Less(i, j int) bool

func (*ConsistentHashSL) List

func (*ConsistentHashSL) Set

func (C *ConsistentHashSL) Set(server ...string) error

func (*ConsistentHashSL) Swap

func (C *ConsistentHashSL) Swap(i, j int)

type SelectorType

type SelectorType uint32
const (
	ModSelector  SelectorType = 1
	HashSelector SelectorType = 2
)

type ServerList

type ServerList struct {
	// contains filtered or unexported fields
}

func (*ServerList) Add

func (S *ServerList) Add(server string, port int) error

func (*ServerList) Get

func (S *ServerList) Get(key []byte) *gmemcached.GMConnection

func (*ServerList) List

func (S *ServerList) List() []*gmemcached.GMConnection

func (*ServerList) Set

func (S *ServerList) Set(server ...string) error

Jump to

Keyboard shortcuts

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