Redis client library for Go

Related tags

go-redis
Overview

go-redis

go-redis is a Redis client library for the Go programming language. It's built on the skeleton of gomemcache.

It is safe to use by multiple goroutines, and scales well by automatically making new connections to redis on demand. Idle connections stay in the connection pool until time out.

Licensed under the Apache License, Version 2.0.

Status

The library is stable and has been extensively tested on freegeoip.net as the underlying quota mechanism on Redis. It has served dozens of billions of queries that used this library to manage usage.

It is incomplete, though. Me, @gleicon, @lxfontes and others have only implemented the commands we needed for our applications so far, and continue doing so with no rush or schedule. See commands.go for a list of supported commands - they're in alphabetical order. Contributors are welcome.

We've written other Redis client libraries before, also very stable and used in large deployments by major companies.

Build Status

Installing

Make sure Go is installed, and both $GOROOT and $GOPATH are set, then run:

$ go get github.com/fiorix/go-redis/redis

Usage

Hello world:

import "github.com/fiorix/go-redis/redis"

func main() {
	rc := redis.New("10.0.0.1:6379", "10.0.0.2:6379", "10.0.0.3:6379")
	rc.Set("foo", "bar")

	v, err := rc.Get("foo")
	...
}

When connected to multiple servers, commands such as PING, INFO and similar are only executed on the first server. GET, SET and others are distributed by their key.

New connections are created on demand, and stay available in the connection pool until they time out. The library scales very well under high load.

Unix socket, dbid and password support

The client supports ip:port or unix socket for connecting to redis.

rc := redis.New("/tmp/redis.sock db=5 passwd=foobared")

Database ID and password can only be set by New() and can't be changed later. If that is required, make a new connection.

Credits

Thanks to (in no particular order):

  • gomemcache: for the skeleton of this client library.
Issues
Owner
Alexandre Fiori
Alexandre Fiori
Type-safe Redis client for Golang

Redis client for Golang ❤️ Uptrace.dev - distributed traces, logs, and errors in one place Join Discord to ask questions. Documentation Reference Exam

null 12k Jul 20, 2021
Redis Sorted Sets Benchmark

redis-zbench-go Redis Sorted Sets Benchmark Overview This repo contains code to trigger load ( ZADD ) or query (ZRANGEBYLEX key min max) benchmarks, w

filipe oliveira 3 May 18, 2021
Go Redis Client

xredis Built on top of github.com/garyburd/redigo with the idea to simplify creating a Redis client, provide type safe calls and encapsulate the low l

Raed Shomali 15 Jun 2, 2021
Distributed WebSocket broker

dSock dSock is a distributed WebSocket broker (in Go, using Redis). Clients can authenticate & connect, and you can send text/binary message as an API

Charles Crete 200 Jul 22, 2021
Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

gokv Simple key-value store abstraction and implementations for Go Contents Features Simple interface Implementations Value types Marshal formats Road

Philipp Gillé 350 Jul 27, 2021
Golang client for redislabs' ReJSON module with support for multilple redis clients (redigo, go-redis)

Go-ReJSON - a golang client for ReJSON (a JSON data type for Redis) Go-ReJSON is a Go client for ReJSON Redis Module. ReJSON is a Redis module that im

Nitish Malhotra 172 Jul 24, 2021
redis client implement by golang, inspired by jedis.

godis redis client implement by golang, refers to jedis. this library implements most of redis command, include normal redis command, cluster command,

piaohao 93 Jul 19, 2021
Google Go Client and Connectors for Redis

Go-Redis Go Clients and Connectors for Redis. The initial release provides the interface and implementation supporting the (~) full set of current Red

Joubin Houshyar 436 Jul 22, 2021
GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right away.

GoBigdis GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right

Riccardo 4 Jul 10, 2021
Redis client library for Go

go-redis go-redis is a Redis client library for the Go programming language. It's built on the skeleton of gomemcache. It is safe to use by multiple g

Alexandre Fiori 45 Jul 14, 2020
Go client for Redis

Redigo Redigo is a Go client for the Redis database. Features A Print-like API with support for all Redis commands. Pipelining, including pipelined tr

null 8.5k Jul 21, 2021
Redis client Mock Provide mock test for redis query

Redis client Mock Provide mock test for redis query, Compatible with github.com/go-redis/redis/v8 Install Confirm that you are using redis.Client the

null 50 Jul 21, 2021
🐺 Deploy Databases and Services Easily for Development and Testing Pipelines.

Peanut provides an API and a command line tool to deploy and configure the commonly used services like databases, message brokers, graphing tools ... etc. It perfectly suited for development, manual testing, automated testing pipelines where mocking is not possible and test drives.

Ahmed 35 Jul 24, 2021
Aerospike Client Go

Aerospike Go Client An Aerospike library for Go. This library is compatible with Go 1.9+ and supports the following operating systems: Linux, Mac OS X

Aerospike 366 Jul 6, 2021