Beispiel #1
0
func CreateMemcacheConnection(Instance interface{}) (pools.Resource, error) {
	mcInstance := Instance.(*Memcache)
	hostNPorts := mcInstance.Settings.HostAndPorts
	servers := strings.Join(hostNPorts, ",")
	fmt.Println("connecting to ", servers)
	cli := memcache.New(hostNPorts...)
	return &MemConn{cli}, nil
}
Beispiel #2
0
// Callback function factory to vitess pool`
func memcacheFactory(key string, server []string) (pool.Resource, error) {
	conn := memcache.New(server...)
	memConn := &MemcacheConn{conn}
	return memConn, nil
}