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 7.9 KiB

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