All Projects → xuyu → Goredis

xuyu / Goredis

Licence: mit
redis client for golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Goredis

Redis Admin
redis client tool,redis web client,redis web ui,spring-boot support
Stars: ✭ 436 (+638.98%)
Mutual labels:  redis, redis-client
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (+1120.34%)
Mutual labels:  redis, redis-client
Stackexchange.redis
General purpose redis client
Stars: ✭ 4,986 (+8350.85%)
Mutual labels:  redis, redis-client
Stackexchange.redis.extensions
Stars: ✭ 419 (+610.17%)
Mutual labels:  redis, redis-client
Redis Py Cluster
Python cluster client for the official redis cluster. Redis 3.0+.
Stars: ✭ 934 (+1483.05%)
Mutual labels:  redis, redis-client
Redis Plus Plus
Redis client written in C++
Stars: ✭ 428 (+625.42%)
Mutual labels:  redis, redis-client
Redis Operator
Redis Operator creates/configures/manages high availability redis with sentinel automatic failover atop Kubernetes.
Stars: ✭ 658 (+1015.25%)
Mutual labels:  redis, redis-client
Fastoredis
FastoRedis is a crossplatform Redis GUI management tool.
Stars: ✭ 316 (+435.59%)
Mutual labels:  redis, redis-client
Redix
Fast, pipelined, resilient Redis driver for Elixir. 🛍
Stars: ✭ 816 (+1283.05%)
Mutual labels:  redis, redis-client
Hslcommunication
An industrial IoT underlying architecture framework, focusing on the underlying technical communications and cross-platform, cross-language communication functions, to achieve a variety of mainstream PLC data reading and writing, to achieve modbus of various protocols read and write, and so on, to support the rapid construction of industrial upper computer software, configuration software, SCADA software, factory mes system, To help enterprise Industry 4.0 take-off, to achieve intelligent manufacturing, smart factory goals. The main PLC contains Siemens, Mitsubishi, Omron, Panasonic, Modbus, AB-PLC, Redis
Stars: ✭ 816 (+1283.05%)
Mutual labels:  redis, redis-client
Lettuce Core
Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
Stars: ✭ 4,319 (+7220.34%)
Mutual labels:  redis, redis-client
Cpp redis
C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform - NO LONGER MAINTAINED - Please check https://github.com/cpp-redis/cpp_redis
Stars: ✭ 855 (+1349.15%)
Mutual labels:  redis, redis-client
Redis
Redis commands for Elixir
Stars: ✭ 357 (+505.08%)
Mutual labels:  redis, redis-client
Redis
Vapor provider for RediStack
Stars: ✭ 434 (+635.59%)
Mutual labels:  redis, redis-client
Crystal Redis
Full featured Redis client for Crystal
Stars: ✭ 345 (+484.75%)
Mutual labels:  redis, redis-client
Quick redis blog
QuickRedis is a free forever Redis Desktop manager. It supports direct connection, sentinel, and cluster mode, supports multiple languages, supports hundreds of millions of keys, and has an amazing UI. Supports both Windows, Mac OS X and Linux platform.
Stars: ✭ 594 (+906.78%)
Mutual labels:  redis, redis-client
Redisclient
Boost.asio based Redis-client library.
Stars: ✭ 289 (+389.83%)
Mutual labels:  redis, redis-client
Redis Cpp17
redis-cpp17 is a cross platfrom compatible redis protocol with multithreaded c++17 client,server,proxy
Stars: ✭ 300 (+408.47%)
Mutual labels:  redis, redis-client
Redis Tui
A Redis Text-based UI client in CLI
Stars: ✭ 757 (+1183.05%)
Mutual labels:  redis, redis-client
Perfect Redis
A Swift client for Redis.
Stars: ✭ 26 (-55.93%)
Mutual labels:  redis, redis-client

goredis

GoDoc

redis client in golang

Go or Golang is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

  • Pure golang, and doesn't depend on any 3rd party libraries;
  • Hight test coverage and will continue to improve;
  • Tested under Go 1.2 and Redis 2.8.3;
  • Tested under Go 1.2.1 and Redis 2.8.4;

Features

Document

Simple Example

Connect:

client, err := Dial()
client, err := Dial(&DialConfig{Address: "127.0.0.1:6379"})
client, err := DialURL("tcp://auth:[email protected]:6379/0?timeout=10s&maxidle=1")

Try a redis command is simple too, let's do GET/SET:

err := client.Set("key", "value", 0, 0, false, false)
value, err := client.Get("key")

Or you can execute a custom command with Redis.ExecuteCommand method:

reply, err := client.ExecuteCommand("SET", "key", "value")
err := reply.OKValue()

And then a Reply struct which represent the redis response data is defined:

type Reply struct {
	Type    int
	Error   string
	Status  string
	Integer int64  // Support Redis 64bit integer
	Bulk    []byte // Support Redis Null Bulk Reply
	Multi   []*Reply
}

Reply.Type is defined as:

const (
	ErrorReply = iota
	StatusReply
	IntegerReply
	BulkReply
	MultiReply
)

Reply struct has many useful methods:

func (rp *Reply) IntegerValue() (int64, error)
func (rp *Reply) BoolValue() (bool, error)
func (rp *Reply) StatusValue() (string, error)
func (rp *Reply) OKValue() error
func (rp *Reply) BytesValue() ([]byte, error)
func (rp *Reply) StringValue() (string, error)
func (rp *Reply) MultiValue() ([]*Reply, error)
func (rp *Reply) HashValue() (map[string]string, error)
func (rp *Reply) ListValue() ([]string, error)
func (rp *Reply) BytesArrayValue() ([][]byte, error)
func (rp *Reply) BoolArrayValue() ([]bool, error)

You can find more examples in test files.

Run Test

normal test:

go test

coverage test:

go test -cover

coverage test with html result:

go test -coverprofile=cover.out
go tool cover -html=cover.out

Welcome to report issues :)

Run Benchmark

go test -test.run=none -test.bench="Benchmark.*"

At my virtualbox Ubuntu 13.04 with single CPU: Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz, get result:

BenchmarkPing	   50000	     40100 ns/op
BenchmarkLPush	   50000	     34939 ns/op
BenchmarkLRange	   50000	     41420 ns/op
BenchmarkGet	   50000	     37948 ns/op
BenchmarkIncr	   50000	     44460 ns/op
BenchmarkSet	   50000	     41300 ns/op

Welcome to show your benchmark result :)

License

The MIT License (MIT) Copyright (c) 2013 xuyu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].