You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CHANGELOG.md 5.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ## [8.11.4](https://github.com/go-redis/redis/compare/v8.11.3...v8.11.4) (2021-10-04)
  2. ### Features
  3. * add acl auth support for sentinels ([f66582f](https://github.com/go-redis/redis/commit/f66582f44f3dc3a4705a5260f982043fde4aa634))
  4. * add Cmd.{String,Int,Float,Bool}Slice helpers and an example ([5d3d293](https://github.com/go-redis/redis/commit/5d3d293cc9c60b90871e2420602001463708ce24))
  5. * add SetVal method for each command ([168981d](https://github.com/go-redis/redis/commit/168981da2d84ee9e07d15d3e74d738c162e264c4))
  6. ## v8.11
  7. - Remove OpenTelemetry metrics.
  8. - Supports more redis commands and options.
  9. ## v8.10
  10. - Removed extra OpenTelemetry spans from go-redis core. Now go-redis instrumentation only adds a
  11. single span with a Redis command (instead of 4 spans). There are multiple reasons behind this
  12. decision:
  13. - Traces become smaller and less noisy.
  14. - It may be costly to process those 3 extra spans for each query.
  15. - go-redis no longer depends on OpenTelemetry.
  16. Eventually we hope to replace the information that we no longer collect with OpenTelemetry
  17. Metrics.
  18. ## v8.9
  19. - Changed `PubSub.Channel` to only rely on `Ping` result. You can now use `WithChannelSize`,
  20. `WithChannelHealthCheckInterval`, and `WithChannelSendTimeout` to override default settings.
  21. ## v8.8
  22. - To make updating easier, extra modules now have the same version as go-redis does. That means that
  23. you need to update your imports:
  24. ```
  25. github.com/go-redis/redis/extra/redisotel -> github.com/go-redis/redis/extra/redisotel/v8
  26. github.com/go-redis/redis/extra/rediscensus -> github.com/go-redis/redis/extra/rediscensus/v8
  27. ```
  28. ## v8.5
  29. - [knadh](https://github.com/knadh) contributed long-awaited ability to scan Redis Hash into a
  30. struct:
  31. ```go
  32. err := rdb.HGetAll(ctx, "hash").Scan(&data)
  33. err := rdb.MGet(ctx, "key1", "key2").Scan(&data)
  34. ```
  35. - Please check [redismock](https://github.com/go-redis/redismock) by
  36. [monkey92t](https://github.com/monkey92t) if you are looking for mocking Redis Client.
  37. ## v8
  38. - All commands require `context.Context` as a first argument, e.g. `rdb.Ping(ctx)`. If you are not
  39. using `context.Context` yet, the simplest option is to define global package variable
  40. `var ctx = context.TODO()` and use it when `ctx` is required.
  41. - Full support for `context.Context` canceling.
  42. - Added `redis.NewFailoverClusterClient` that supports routing read-only commands to a slave node.
  43. - Added `redisext.OpenTemetryHook` that adds
  44. [Redis OpenTelemetry instrumentation](https://redis.uptrace.dev/tracing/).
  45. - Redis slow log support.
  46. - Ring uses Rendezvous Hashing by default which provides better distribution. You need to move
  47. existing keys to a new location or keys will be inaccessible / lost. To use old hashing scheme:
  48. ```go
  49. import "github.com/golang/groupcache/consistenthash"
  50. ring := redis.NewRing(&redis.RingOptions{
  51. NewConsistentHash: func() {
  52. return consistenthash.New(100, crc32.ChecksumIEEE)
  53. },
  54. })
  55. ```
  56. - `ClusterOptions.MaxRedirects` default value is changed from 8 to 3.
  57. - `Options.MaxRetries` default value is changed from 0 to 3.
  58. - `Cluster.ForEachNode` is renamed to `ForEachShard` for consistency with `Ring`.
  59. ## v7.3
  60. - New option `Options.Username` which causes client to use `AuthACL`. Be aware if your connection
  61. URL contains username.
  62. ## v7.2
  63. - Existing `HMSet` is renamed to `HSet` and old deprecated `HMSet` is restored for Redis 3 users.
  64. ## v7.1
  65. - Existing `Cmd.String` is renamed to `Cmd.Text`. New `Cmd.String` implements `fmt.Stringer`
  66. interface.
  67. ## v7
  68. - _Important_. Tx.Pipeline now returns a non-transactional pipeline. Use Tx.TxPipeline for a
  69. transactional pipeline.
  70. - WrapProcess is replaced with more convenient AddHook that has access to context.Context.
  71. - WithContext now can not be used to create a shallow copy of the client.
  72. - New methods ProcessContext, DoContext, and ExecContext.
  73. - Client respects Context.Deadline when setting net.Conn deadline.
  74. - Client listens on Context.Done while waiting for a connection from the pool and returns an error
  75. when context context is cancelled.
  76. - Add PubSub.ChannelWithSubscriptions that sends `*Subscription` in addition to `*Message` to allow
  77. detecting reconnections.
  78. - `time.Time` is now marshalled in RFC3339 format. `rdb.Get("foo").Time()` helper is added to parse
  79. the time.
  80. - `SetLimiter` is removed and added `Options.Limiter` instead.
  81. - `HMSet` is deprecated as of Redis v4.
  82. ## v6.15
  83. - Cluster and Ring pipelines process commands for each node in its own goroutine.
  84. ## 6.14
  85. - Added Options.MinIdleConns.
  86. - Added Options.MaxConnAge.
  87. - PoolStats.FreeConns is renamed to PoolStats.IdleConns.
  88. - Add Client.Do to simplify creating custom commands.
  89. - Add Cmd.String, Cmd.Int, Cmd.Int64, Cmd.Uint64, Cmd.Float64, and Cmd.Bool helpers.
  90. - Lower memory usage.
  91. ## v6.13
  92. - Ring got new options called `HashReplicas` and `Hash`. It is recommended to set
  93. `HashReplicas = 1000` for better keys distribution between shards.
  94. - Cluster client was optimized to use much less memory when reloading cluster state.
  95. - PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout
  96. occurres. In most cases it is recommended to use PubSub.Channel instead.
  97. - Dialer.KeepAlive is set to 5 minutes by default.
  98. ## v6.12
  99. - ClusterClient got new option called `ClusterSlots` which allows to build cluster of normal Redis
  100. Servers that don't have cluster mode enabled. See
  101. https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup