You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,40 @@ func ExampleClient() {
105
105
}
106
106
```
107
107
108
+
The above can be modified to specify the version of the RESP protocol by adding the `protocol` option to the `Options` struct:
109
+
110
+
```go
111
+
rdb:= redis.NewClient(&redis.Options{
112
+
Addr: "localhost:6379",
113
+
Password: "", // no password set
114
+
DB: 0, // use default DB
115
+
Protocol: 3, // specify 2 for RESP 2 or 3 for RESP 3
116
+
})
117
+
118
+
```
119
+
120
+
### Connecting via a redis url
121
+
122
+
go-redis also supports connecting via the [redis uri specification](https://github.com/redis/redis-specifications/tree/master/uri/redis.txt). The example below demonstrates how the connection can easily be configured using a string, adhering to this specification.
0 commit comments