Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
Redis 3 commands except QUIT, MONITOR, and SYNC.
Automatic connection pooling with circuit breaker support.
Pipeline and TxPipeline.
Cluster of Redis Servers without using cluster mode and Redis Sentinel.
go-redis supports 2 last Go versions and requires a Go version with modules support. So make sure to initialize a Go module:
$ go mod init github.com/my/repo
And then install go-redis/v8 (note v8 in the import; omitting it is a popular mistake):