Skip to content

nightmeng/redicluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Redis Cluster

RediCluster is a redis cluster package based on redigo.

Installation

Install RediCluster using the "go get" command:

go get githup.com/nightmeng/redicluster

Example

The following is a example:

package main

import(
	"githup.com/nightment/redicluster"
)

func main() {
	cluster := redicluster.NewRediCluster([]string{"redis://127.0.0.1"})
	
	conn, err := cluster.GetConn("xxx")
	if err ! = nil {
		fmt.Printf("Get redis connection failed, %s", err)
		return
	}
	defer conn.Close()
	
	_, err = conn.Do("INCR", "test-incr")
	if err != nil {
		fmt.Printf("INCR failed, %s", err)
		return
	}
}

About

Redis cluster based on redigo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages